projeto-hit/backend/src/services/SchedulingNotifyServices/DeleteSchedulingNotifyServi...

17 lines
485 B
TypeScript
Raw Normal View History

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;