28 lines
566 B
JavaScript
28 lines
566 B
JavaScript
|
|
import Handlebars from "handlebars";
|
|
|
|
export const usePrintLabel = async (printServerId,printerName , rawZPL ) => {
|
|
const supabase = useSupabaseClient()
|
|
const dataStore = useDataStore()
|
|
const profileStore = useProfileStore()
|
|
|
|
await supabase.from("printJobs").insert({
|
|
tenant: profileStore.currentTenant,
|
|
rawContent: rawZPL,
|
|
printerName: printerName,
|
|
printServer: printServerId
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
export const useGenerateZPL = (rawZPL,data) => {
|
|
let template = Handlebars.compile(rawZPL)
|
|
|
|
return template(data)
|
|
}
|
|
|
|
|
|
|