Allow Avery label sheets to start at an unused position (#2879) (#2918)

This commit is contained in:
Whitigol
2026-08-26 08:57:44 +02:00
committed by GitHub
parent 14f46510ba
commit a68933cb2f
21 changed files with 452 additions and 38 deletions
+9 -2
View File
@@ -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`, {