mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 21:47:39 +02:00
Fix PrintModal to fetch library file sliced_for_model
- Added query to fetch library file details in PrintModal - Updated backend FileResponse schema to include metadata fields (print_name, print_time_seconds, filament_used_grams, sliced_for_model) - Updated backend get_file endpoint to extract and return metadata fields - Updated frontend LibraryFile interface to include metadata fields - Now slicedForModel is properly extracted from both archives and library files Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
This commit is contained in:
co-authored by
cadtoolbox
parent
5b1e3e7a2b
commit
4cf58f9805
@@ -180,8 +180,15 @@ export function PrintModal({
|
||||
enabled: !!archiveId && !isLibraryFile,
|
||||
});
|
||||
|
||||
// Fetch library file details to get sliced_for_model
|
||||
const { data: libraryFileDetails } = useQuery({
|
||||
queryKey: ['library-file', libraryFileId],
|
||||
queryFn: () => api.getLibraryFile(libraryFileId!),
|
||||
enabled: isLibraryFile && !!libraryFileId,
|
||||
});
|
||||
|
||||
// Get sliced_for_model from archive or library file
|
||||
const slicedForModel = archiveDetails?.sliced_for_model || null;
|
||||
const slicedForModel = archiveDetails?.sliced_for_model || libraryFileDetails?.sliced_for_model || null;
|
||||
|
||||
// Fetch plates for archives
|
||||
const { data: archivePlatesData, isError: archivePlatesError } = useQuery({
|
||||
|
||||
Reference in New Issue
Block a user