improvement: translated all backend errors messages

This commit is contained in:
canove
2020-10-13 22:53:05 -03:00
parent 558475f121
commit a567614c63
45 changed files with 308 additions and 120 deletions

View File

@@ -7,7 +7,7 @@ const DeleteWhatsApprService = async (id: string): Promise<void> => {
});
if (!whatsapp) {
throw new AppError("No whatsapp found with this ID.", 404);
throw new AppError("ERR_NO_WAPP_FOUND", 404);
}
await whatsapp.destroy();

View File

@@ -7,7 +7,7 @@ const ShowWhatsAppService = async (
const whatsapp = await Whatsapp.findByPk(id);
if (!whatsapp) {
throw new AppError("No whatsapp found with this conditions.", 404);
throw new AppError("ERR_NO_WAPP_FOUND", 404);
}
return whatsapp;

View File

@@ -51,7 +51,7 @@ const UpdateWhatsAppService = async ({
});
if (!whatsapp) {
throw new AppError("No whatsapp found with this ID.", 404);
throw new AppError("ERR_NO_WAPP_FOUND", 404);
}
await whatsapp.update({