14 lines
414 B
TypeScript
14 lines
414 B
TypeScript
|
import StatusChatEnd from "../../models/StatusChatEnd";
|
||
|
import AppError from "../../errors/AppError";
|
||
|
|
||
|
const ShowStatusChatEndService = async (id: string | number): Promise<StatusChatEnd> => {
|
||
|
const status = await StatusChatEnd.findByPk(id, { attributes: ['id', 'name'], });
|
||
|
|
||
|
if (!status) {
|
||
|
throw new AppError("ERR_NO_STATUS_FOUND", 404);
|
||
|
}
|
||
|
|
||
|
return status;
|
||
|
};
|
||
|
|
||
|
export default ShowStatusChatEndService;
|