deliver Hongfa Laundry M1 desktop release
This commit is contained in:
12
src/main/ipc/printer.ts
Normal file
12
src/main/ipc/printer.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { IdSchema } from "../../shared/schemas";
|
||||
import { OrderService } from "../services/orderService";
|
||||
import { PrinterService } from "../services/printerService";
|
||||
import { registerIpcHandler } from "./helpers";
|
||||
|
||||
export function registerPrinterIpc(): void {
|
||||
registerIpcHandler("printer:printReceipt", IdSchema, async (orderId) => {
|
||||
const order = await OrderService.findById(orderId);
|
||||
if (!order) throw new Error("订单不存在");
|
||||
return await PrinterService.printReceipt(order);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user