17 lines
485 B
TypeScript
17 lines
485 B
TypeScript
|
import AppError from "../../errors/AppError";
|
||
|
import SchedulingNotify from "../../models/SchedulingNotify";
|
||
|
|
||
|
|
||
|
const DeleteSchedulingNotifyService = async (id: string | number): Promise<void> => {
|
||
|
const schedulingNotify = await SchedulingNotify.findOne({
|
||
|
where: { id }
|
||
|
});
|
||
|
|
||
|
if (!schedulingNotify) {
|
||
|
throw new AppError("ERR_NO_SCHEDULING_NOTIFY_FOUND", 404);
|
||
|
}
|
||
|
|
||
|
await schedulingNotify.destroy();
|
||
|
};
|
||
|
|
||
|
export default DeleteSchedulingNotifyService;
|