mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-09 15:35:39 +02:00
This commit is contained in:
@@ -3465,6 +3465,13 @@ export type SpoolLabelTemplate =
|
||||
| 'avery_5160'
|
||||
| 'avery_l7160';
|
||||
|
||||
export interface PrintSpoolLabelsRequest {
|
||||
spool_ids: number[];
|
||||
template: SpoolLabelTemplate;
|
||||
monochrome: boolean;
|
||||
starting_position: number;
|
||||
}
|
||||
|
||||
export interface InventorySpool {
|
||||
id: number;
|
||||
material: string;
|
||||
@@ -6360,7 +6367,7 @@ export const api = {
|
||||
// ── Spool label printing (#809) ──────────────────────────────────────────
|
||||
// Both endpoints return application/pdf. Frontend opens the resulting Blob
|
||||
// in a new tab so the user can print or save from the browser's PDF viewer.
|
||||
printSpoolLabels: async (data: { spool_ids: number[]; template: SpoolLabelTemplate; monochrome?: boolean }): Promise<Blob> => {
|
||||
printSpoolLabels: async (data: PrintSpoolLabelsRequest): Promise<Blob> => {
|
||||
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
||||
if (authToken) headers['Authorization'] = `Bearer ${authToken}`;
|
||||
const response = await fetch(`${API_BASE}/inventory/labels`, {
|
||||
@@ -6374,7 +6381,7 @@ export const api = {
|
||||
}
|
||||
return response.blob();
|
||||
},
|
||||
printSpoolmanSpoolLabels: async (data: { spool_ids: number[]; template: SpoolLabelTemplate; monochrome?: boolean }): Promise<Blob> => {
|
||||
printSpoolmanSpoolLabels: async (data: PrintSpoolLabelsRequest): Promise<Blob> => {
|
||||
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
||||
if (authToken) headers['Authorization'] = `Bearer ${authToken}`;
|
||||
const response = await fetch(`${API_BASE}/spoolman/labels`, {
|
||||
|
||||
Reference in New Issue
Block a user