From 75718100b9bbe80cf47e33e832a74d410b8818a2 Mon Sep 17 00:00:00 2001 From: PedroVidalDev Date: Mon, 22 Apr 2024 20:51:53 -0300 Subject: [PATCH] feat: saving the access error in database --- src/main/java/com/pedro/sphynx/domain/AccessService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/pedro/sphynx/domain/AccessService.java b/src/main/java/com/pedro/sphynx/domain/AccessService.java index 2975193..71ca985 100644 --- a/src/main/java/com/pedro/sphynx/domain/AccessService.java +++ b/src/main/java/com/pedro/sphynx/domain/AccessService.java @@ -61,6 +61,10 @@ public AccessDataComplete validateCreation(AccessDataInput data, String language LocalDataComplete local = new LocalDataComplete(localRepository.findByMac(data.local())); if(local.permission() > consumer.permission()){ + var access = new Access(null, consumerRepository.findByTag(data.tag()), localRepository.findByName(data.local()), false, LocalDateTime.now()); + + accessRepository.save(access); + throw new Validation(messages.getString("error.consumerDontHavePermission")); }