Funciona
This commit is contained in:
@@ -62,6 +62,23 @@ app.whenReady().then(() => {
|
||||
// HANDLE es bidireccionar ON es unidireccional
|
||||
ipcMain.handle("nfc:labelReq", async (_event, data: unknown) => {
|
||||
console.log("nfc:labelReq", data);
|
||||
try {
|
||||
const response = await fetch("http://localhost:3000/nfc/generate", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
card_id: "019cdd39-fc08-7417-b16d-a78794a24c01",
|
||||
override: false,
|
||||
}),
|
||||
});
|
||||
console.log("Codigos:", response);
|
||||
return 200;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return false;
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user