2022-05-19 21:29:38 +00:00
|
|
|
import StatusChatEnd from "../../models/StatusChatEnd";
|
|
|
|
import AppError from "../../errors/AppError";
|
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
const ShowStatusChatEndService = async (
|
|
|
|
id: string | number
|
|
|
|
): Promise<StatusChatEnd> => {
|
|
|
|
const status = await StatusChatEnd.findByPk(id, {
|
|
|
|
attributes: ["id", "name"]
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log(`---------------> statusChatEnd id: ${id}`);
|
2022-05-19 21:29:38 +00:00
|
|
|
|
|
|
|
if (!status) {
|
|
|
|
throw new AppError("ERR_NO_STATUS_FOUND", 404);
|
|
|
|
}
|
|
|
|
|
|
|
|
return status;
|
|
|
|
};
|
|
|
|
|
2023-07-20 15:30:26 +00:00
|
|
|
export default ShowStatusChatEndService;
|