feature/IO-3096-GlobalNotifications - Checkpoint - Fix user getting all bodyshop notifications (now by associationId), fix regression in 'Assigned To' scenario.

This commit is contained in:
Dave Richer
2025-02-26 13:11:49 -05:00
parent b86309e74b
commit 0767e290f4
8 changed files with 99 additions and 65 deletions

View File

@@ -19,8 +19,8 @@ export const GET_NOTIFICATIONS = gql`
`;
export const GET_UNREAD_COUNT = gql`
query GetUnreadCount {
notifications_aggregate(where: { read: { _is_null: true } }) {
query GetUnreadCount($associationid: uuid!) {
notifications_aggregate(where: { read: { _is_null: true }, associationid: { _eq: $associationid } }) {
aggregate {
count
}
@@ -29,8 +29,11 @@ export const GET_UNREAD_COUNT = gql`
`;
export const MARK_ALL_NOTIFICATIONS_READ = gql`
mutation MarkAllNotificationsRead {
update_notifications(where: { read: { _is_null: true } }, _set: { read: "now()" }) {
mutation MarkAllNotificationsRead($associationid: uuid!) {
update_notifications(
where: { read: { _is_null: true }, associationid: { _eq: $associationid } }
_set: { read: "now()" }
) {
affected_rows
}
}