From 3aa4a62b5a675b7b4556ae75a96015521dd670e5 Mon Sep 17 00:00:00 2001 From: adriano Date: Tue, 18 Apr 2023 18:02:43 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20da=20atualiza=C3=A7=C3=A3o?= =?UTF-8?q?=20do=20contato?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/services/ContactServices/UpdateContactService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/services/ContactServices/UpdateContactService.ts b/backend/src/services/ContactServices/UpdateContactService.ts index a4963e5..55b49df 100644 --- a/backend/src/services/ContactServices/UpdateContactService.ts +++ b/backend/src/services/ContactServices/UpdateContactService.ts @@ -70,7 +70,7 @@ const UpdateContactService = async ({ where: { number } }); - if (numberExists) { + if (numberExists && numberExists.id != +contactId) { throw new AppError("ERR_DUPLICATED_CONTACT"); } }