All files / libs/tenants/users/state/src/lib queries.keys.ts

95.23% Statements 20/21
100% Branches 2/2
25% Functions 2/8
95.23% Lines 20/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 221x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x 1x 1x 1x 1x  
import { type UserContract } from '@amalia/tenants/users/types';
 
import { type UserApiClient } from './api-client/user.api-client';
 
export const userInformationQueryKeys = {
  all: () => ['user-information'] as const,
  list: () => [...userInformationQueryKeys.all(), 'list'] as const,
  byProperty: (property: string, value: string) =>
    [...userInformationQueryKeys.all(), 'by-property', property, value] as const,
  ofUser: {
    all: (userId?: UserContract['id']) => [...userInformationQueryKeys.all(), 'of-user', userId] as const,
    managers: ({ userId, ...rest }: Parameters<(typeof UserApiClient)['getUserManagers']>[0]) =>
      [...userInformationQueryKeys.ofUser.all(userId), 'managers', rest] as const,
  },
} as const;
 
export const notificationsQueryKeys = {
  all: () => ['notifications'] as const,
  unreadCount: () => [...notificationsQueryKeys.all(), 'unread-count'] as const,
  pages: () => [...notificationsQueryKeys.all(), 'pages'] as const,
} as const;