upd: fungsi delete iddevice yg gagal fcm
This commit is contained in:
17
src/module/_global/fun/delete_device_error.ts
Normal file
17
src/module/_global/fun/delete_device_error.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { prisma } from "@/module/_global";
|
||||
|
||||
export default async function deleteDeviceError({ device }: { device: string[] }) {
|
||||
try {
|
||||
const deleteToken = await prisma.tokenDeviceUser.deleteMany({
|
||||
where: {
|
||||
token: {
|
||||
in: device
|
||||
}
|
||||
}
|
||||
});
|
||||
return { success: true, message: "Success" }
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
return { success: false, message: "Internal Server Error" }
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import { funSendWebPush } from "./fun/send_web_push";
|
||||
import ViewFilterData from "./view/view_filter_kategori_data";
|
||||
import LayoutModalNew from "./layout/layout_modal_new";
|
||||
import { funReadPdf } from "./fun/read_pdf";
|
||||
import deleteDeviceError from "./fun/delete_device_error";
|
||||
|
||||
export { WARNA };
|
||||
export { LayoutLogin };
|
||||
@@ -68,4 +69,5 @@ export { funViewDir }
|
||||
export { funSendWebPush }
|
||||
export { ViewFilterData }
|
||||
export { LayoutModalNew }
|
||||
export { funReadPdf }
|
||||
export { funReadPdf }
|
||||
export { deleteDeviceError }
|
||||
Reference in New Issue
Block a user