From 332068c8a6a4e2a6c91dd5ccf7aaf3a6c513c70a Mon Sep 17 00:00:00 2001 From: toki-ai Date: Sat, 9 Nov 2024 03:12:28 +0700 Subject: [PATCH] [PBS-84][Anh Dao] fix: get staff by staff --- .../PodBookingSystem/controller/AccountController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/swp/PodBookingSystem/controller/AccountController.java b/src/main/java/com/swp/PodBookingSystem/controller/AccountController.java index 250a4bbd..df6ef268 100644 --- a/src/main/java/com/swp/PodBookingSystem/controller/AccountController.java +++ b/src/main/java/com/swp/PodBookingSystem/controller/AccountController.java @@ -33,6 +33,7 @@ import java.io.IOException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.List; @RestController @@ -201,7 +202,12 @@ else if (account.getRole().equals(AccountRole.Manager)) { .build(); } else { - throw new AppException(ErrorCode.UNAUTHORIZED); + List list = new ArrayList<>(); + list.add(new AccountOrderResponse(account.getId(), account.getName(), account.getEmail(), account.getAvatar(), account.getRole(), account.getBuildingNumber(), account.getRankingName())); + return ApiResponse.>builder() + .message("Không có quyền truy cập") + .data(list) + .build(); } } }