This commit is contained in:
Viet An
2026-06-26 13:34:01 +07:00
parent f759ca49d5
commit 1262dc6d82
4 changed files with 39 additions and 30 deletions

View File

@@ -6,10 +6,10 @@ const execFileAsync = promisify(execFile);
export default defineEventHandler(async (event) => {
const body = await readBody(event);
const { name, imei, price } = body;
const { items } = body;
const scriptPath = path.join(process.cwd(), "print", "print_barcode.py");
const payload = JSON.stringify({ name, imei, price });
const payload = JSON.stringify({ items });
try {
const { stdout } = await execFileAsync("python", [scriptPath, payload]);