Skip to content

Commit ef5de3b

Browse files
committed
fix: update getNotifications method to use userId instead of organizationId
Signed-off-by: Mohsen Karimi <mohsenk.work@gmail.com>
1 parent 816bffa commit ef5de3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/app/teamwize/api/notification/rest/controller/NotificationController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class NotificationController {
4444
@GetMapping
4545
public PagedResponse<NotificationResponse> getNotifications(@ParameterObject @Valid NotificationFilterRequest request,
4646
@ParameterObject @Valid PaginationRequest pagination) {
47-
var result = notificationService.getNotifications(securityService.getUserOrganizationId(),
47+
var result = notificationService.getNotifications(securityService.getUserId(),
4848
notificationRestMapper.toCommand(request),
4949
pagination
5050
);

src/main/java/app/teamwize/api/notification/service/NotificationService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ public Notification getNotification(Long userId, Long id) throws NotificationNot
9999

100100
@Transactional(readOnly = true)
101101
public Paged<Notification> getNotifications(
102-
Long organizationId,
102+
Long userId,
103103
NotificationFilterCommand command,
104104
PaginationRequest pagination) {
105105
var sort = Sort.by("id").descending();
106106
var pageRequest = PageRequest.of(pagination.getPageNumber(), pagination.getPageSize(), sort);
107107

108-
var specs = Specification.where(withOrganizationId(organizationId))
108+
var specs = Specification.where(withUserId(userId))
109109
.and(withStatus(command.status()))
110110
.and(withEventType(command.eventType()));
111111

0 commit comments

Comments
 (0)