diff --git a/src/routes/functions.ts b/src/routes/functions.ts index 651aba4..dc1551b 100644 --- a/src/routes/functions.ts +++ b/src/routes/functions.ts @@ -1,9 +1,9 @@ import { FastifyInstance } from "fastify"; import {createInvoicePDF, createTimeSheetPDF} from "../utils/pdf"; -import {encodeBase64ToNiimbot, generateLabel, useNextNumberRangeNumber} from "../utils/functions"; +//import {encodeBase64ToNiimbot, generateLabel, useNextNumberRangeNumber} from "../utils/functions"; import dayjs from "dayjs"; -import { ready as zplReady } from 'zpl-renderer-js' -import { renderZPL } from "zpl-image"; +//import { ready as zplReady } from 'zpl-renderer-js' +//import { renderZPL } from "zpl-image"; import customParseFormat from "dayjs/plugin/customParseFormat.js"; import isoWeek from "dayjs/plugin/isoWeek.js"; @@ -155,7 +155,7 @@ export default async function functionRoutes(server: FastifyInstance) { } }) - server.post('/print/zpl/preview', async (req, reply) => { + /*server.post('/print/zpl/preview', async (req, reply) => { const { zpl, widthMm = 50, heightMm = 30, dpmm = 8, asBase64 = false } = req.body as {zpl:string,widthMm:number,heightMm:number,dpmm:number,asBase64:string} console.log(widthMm,heightMm,dpmm) @@ -192,6 +192,6 @@ export default async function functionRoutes(server: FastifyInstance) { console.error('[ZPL Preview Error]', err) return reply.code(500).send({ error: err.message || 'Failed to render ZPL' }) } - }) + })*/ } \ No newline at end of file diff --git a/src/routes/staff/time.ts b/src/routes/staff/time.ts index d5d2cda..3daa30c 100644 --- a/src/routes/staff/time.ts +++ b/src/routes/staff/time.ts @@ -7,7 +7,7 @@ export default async function staffTimeRoutes(server: FastifyInstance) { server.post( '/staff/time', async (req, reply) => { - const { started_at, stopped_at, type = 'work', description, user_id } = req.body + const { started_at, stopped_at, type = 'work', description, user_id } = req.body as any const userId = req.user.user_id const tenantId = req.user.tenant_id diff --git a/src/utils/functions.ts b/src/utils/functions.ts index 740db75..3190a87 100644 --- a/src/utils/functions.ts +++ b/src/utils/functions.ts @@ -1,11 +1,11 @@ import {FastifyInstance} from "fastify"; -import { PNG } from 'pngjs' -import { ready as zplReady } from 'zpl-renderer-js' -import { Utils } from '@mmote/niimbluelib' -import { createCanvas } from 'canvas' -import bwipjs from 'bwip-js' -import Sharp from 'sharp' -import fs from 'fs' +// import { PNG } from 'pngjs' +// import { ready as zplReady } from 'zpl-renderer-js' +// import { Utils } from '@mmote/niimbluelib' +// import { createCanvas } from 'canvas' +// import bwipjs from 'bwip-js' +// import Sharp from 'sharp' +// import fs from 'fs' export const useNextNumberRangeNumber = async (server:FastifyInstance, tenantId:number,numberRange)=> { const {data:tenant} = await server.supabase.from("tenants").select().eq("id",tenantId).single() @@ -29,6 +29,7 @@ export const useNextNumberRangeNumber = async (server:FastifyInstance, tenantId: } } +/* export async function encodeBase64ToNiimbot(base64Png, printDirection = 'top') { // 1️⃣ PNG dekodieren const buffer = Buffer.from(base64Png, 'base64') @@ -140,4 +141,4 @@ export async function generateLabel(context,width,height) { const base64 = final.toString('base64') return base64 -} \ No newline at end of file +}*/