@omniumretail/shared-resources 0.3.19 → 0.3.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { BellNotification } from '../../interfaces';
3
+ export interface editAllBellNotificationStatusProps extends UseQueryOptions<BellNotification> {
4
+ userId: string;
5
+ }
6
+ export declare const editAllBellNotificationStatusQueryHook: ({ userId }: editAllBellNotificationStatusProps) => import("@tanstack/react-query").UseMutationResult<BellNotification, unknown, BellNotification, unknown>;
@@ -383,6 +383,7 @@ export * from "./Others/postUserAuthenticationQuery.hook";
383
383
  export * from "./Others//editFieldsByBulkQuery.hook";
384
384
  export * from "./Others/getBellNotificationsQuery.hook";
385
385
  export * from "./Others/editBellNotificationsStatusQuery.hook";
386
+ export * from "./Others/editAllBellNotificationsStatusQuery.hook";
386
387
  export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
387
388
  export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
388
389
  export * from "./Others/Vacation/others/postVacationPlanQuery.hook";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,19 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { BellNotification } from '../../interfaces';
3
+ import { putAuth0 } from '../../services/ApiService';
4
+
5
+ export interface editAllBellNotificationStatusProps extends UseQueryOptions<BellNotification> {
6
+ userId: string;
7
+ }
8
+
9
+ export const editAllBellNotificationStatusQueryHook = ({ userId }: editAllBellNotificationStatusProps) => {
10
+ const queryClient = useQueryClient();
11
+ return useMutation<BellNotification, unknown, BellNotification>((data: BellNotification) => {
12
+ return putAuth0(`/ANOT/Notifications/${userId}/ReadAll`, undefined, data);
13
+ }, {
14
+ onSuccess: (data: BellNotification) => {
15
+ queryClient.setQueryData(
16
+ ['BELL_NOTIFICATION_QUERY'], data);
17
+ },
18
+ });
19
+ }
@@ -450,6 +450,7 @@ export * from "./Others/postUserAuthenticationQuery.hook";
450
450
  export * from "./Others//editFieldsByBulkQuery.hook";
451
451
  export * from "./Others/getBellNotificationsQuery.hook";
452
452
  export * from "./Others/editBellNotificationsStatusQuery.hook";
453
+ export * from "./Others/editAllBellNotificationsStatusQuery.hook";
453
454
  export * from "./Others/Vacation/get/getVacationPlanQuery.hook";
454
455
  export * from "./Others/Vacation/others/aproveVacationPlanQuery.hook";
455
456
  export * from "./Others/Vacation/others/postVacationPlanQuery.hook";