diff --git a/src/routes/(print)/print/batch/+page.server.ts b/src/routes/(print)/print/batch/+page.server.ts index 88252f6..de901ba 100644 --- a/src/routes/(print)/print/batch/+page.server.ts +++ b/src/routes/(print)/print/batch/+page.server.ts @@ -3,7 +3,7 @@ import { db } from '$lib/server/db/index.js'; import { devices } from '$lib/server/db/schema.js'; import { sql } from 'drizzle-orm'; import { error } from '@sveltejs/kit'; -import { generateQrSvg } from '$lib/server/qr.js'; +import { generateBarcodeSvg } from '$lib/server/barcode.js'; export const load: PageServerLoad = async ({ url }) => { const idsParam = url.searchParams.get('ids'); @@ -26,12 +26,11 @@ export const load: PageServerLoad = async ({ url }) => { .from(devices) .where(sql`${devices.id} IN ${ids}`); - // Generate QR codes for each const labels = await Promise.all( deviceList.map(async (device) => { const shortId = device.id.slice(0, 8).toUpperCase(); - const qrSvg = await generateQrSvg(shortId); - return { ...device, qrSvg, shortId }; + const barcodeDataUrl = await generateBarcodeSvg(shortId); + return { ...device, barcodeDataUrl, shortId }; }) ); diff --git a/src/routes/(print)/print/batch/+page.svelte b/src/routes/(print)/print/batch/+page.svelte index 3f68bb8..4a0e925 100644 --- a/src/routes/(print)/print/batch/+page.svelte +++ b/src/routes/(print)/print/batch/+page.svelte @@ -32,30 +32,25 @@ {#each data.labels as label}