Added Frontend
This commit is contained in:
27
frontend/composables/usePrintLabel.js
Normal file
27
frontend/composables/usePrintLabel.js
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user