2022-01-06 01:26:15 +00:00
|
|
|
import ShowQueueService from "./ShowQueueService";
|
|
|
|
|
2022-04-17 21:02:15 +00:00
|
|
|
import UserQueue from "../../models/UserQueue";
|
|
|
|
|
2022-01-06 01:26:15 +00:00
|
|
|
const DeleteQueueService = async (queueId: number | string): Promise<void> => {
|
|
|
|
const queue = await ShowQueueService(queueId);
|
|
|
|
|
2022-04-17 21:02:15 +00:00
|
|
|
try {
|
|
|
|
await UserQueue.destroy({ where: {queueId: queueId } });
|
|
|
|
} catch (error) {
|
|
|
|
console.log('Error on delete UserQueue by queueId: ',queueId)
|
|
|
|
}
|
|
|
|
|
2022-01-06 01:26:15 +00:00
|
|
|
await queue.destroy();
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DeleteQueueService;
|