hunk.code_window:     return payload;
     }
     private setNestedKey(obj, path, value) {
       if (path.length === 1) {
         obj[path[0]] = value;
         return;
       }
  
hunk.labels: keep keep keep keep keep replace keep keep keep
hunk.after_edit:       if (value !== '') {
           obj[path[0]] = value;
         }
  
hunk.file_path: apps/api/src/app/shared/helpers/verify-payload.service.ts
hunk.type: replace
file: import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query';
  import type { IStoreQuery } from '@novu/client';
  import type { IMessage, IPaginatedResponse } from '@novu/shared';
  
  import { useNovuContext } from './useNovuContext';
  import { INFINITE_NOTIFICATIONS_QUERY_KEY } from './queryKeys';
  import { getNextPageParam } from '../utils/pagination';
  
  export const useFetchNotifications = (
    { query }: { query?: IStoreQuery },
    options: UseInfiniteQueryOptions<IPaginatedResponse<IMessage>, Error, IPaginatedResponse<IMessage>> = {}
  ) => {
    const { apiService, isSessionInitialized, fetchingStrategy } = useNovuContext();
  
    const result = useInfiniteQuery<IPaginatedResponse<IMessage>, Error, IPaginatedResponse<IMessage>>(
      [...INFINITE_NOTIFICATIONS_QUERY_KEY, query],
      ({ pageParam = 0 }) => apiService.getNotificationsList(pageParam, query),
      {
        ...options,
        enabled: isSessionInitialized && fetchingStrategy.fetchNotifications,
        getNextPageParam,
      }
    );
  
    return result;
  };
  