@omniumretail/shared-resources 0.2.69 → 0.2.70

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,7 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import { BellNotification } from '../../interfaces';
3
+ export interface editBellNotificationStatusProps extends UseQueryOptions<BellNotification> {
4
+ userId: string;
5
+ notificationId: string;
6
+ }
7
+ export declare const editBellNotificationStatusQueryHook: ({ userId, notificationId }: editBellNotificationStatusProps) => import("@tanstack/react-query").UseMutationResult<BellNotification, unknown, BellNotification, unknown>;
@@ -313,3 +313,4 @@ export * from "./Others/useRegulationQuery.hook";
313
313
  export * from "./Others/postUserAuthenticationQuery.hook";
314
314
  export * from "./Others//editFieldsByBulkQuery.hook";
315
315
  export * from "./Others/getBellNotificationsQuery.hook";
316
+ export * from "./Others/editBellNotificationsStatusQuery.hook";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.69",
3
+ "version": "0.2.70",
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,22 @@
1
+ import { UseQueryOptions, useMutation, useQueryClient } from '@tanstack/react-query';
2
+ import { BellNotification } from '../../interfaces';
3
+ import { putAuth0 } from '../../services/ApiService';
4
+
5
+ export interface editBellNotificationStatusProps extends UseQueryOptions<BellNotification> {
6
+ userId: string;
7
+ notificationId: string;
8
+ }
9
+
10
+ export const editBellNotificationStatusQueryHook = ({ userId, notificationId }: editBellNotificationStatusProps) => {
11
+ const queryClient = useQueryClient();
12
+ return useMutation<BellNotification, unknown, BellNotification>((data: BellNotification) => {
13
+ return putAuth0(`/ANOT/Notifications/${notificationId}?`, {
14
+ pUserId: userId
15
+ }, data);
16
+ }, {
17
+ onSuccess: (data: BellNotification) => {
18
+ queryClient.setQueryData(
19
+ ['BELL_NOTIFICATION_QUERY'], data);
20
+ },
21
+ });
22
+ }
@@ -375,3 +375,4 @@ export * from "./Others/useRegulationQuery.hook";
375
375
  export * from "./Others/postUserAuthenticationQuery.hook";
376
376
  export * from "./Others//editFieldsByBulkQuery.hook";
377
377
  export * from "./Others/getBellNotificationsQuery.hook";
378
+ export * from "./Others/editBellNotificationsStatusQuery.hook";