@omniumretail/shared-resources 0.3.67 → 0.3.68

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,8 @@
1
+ interface ReactivateVoucherProps {
2
+ voucherId: string;
3
+ userId: string;
4
+ }
5
+ export declare const reactivateVoucher: ({ voucherId, userId }: ReactivateVoucherProps) => import("@tanstack/react-query").UseMutationResult<{
6
+ Success: boolean;
7
+ }, unknown, void, unknown>;
8
+ export {};
@@ -309,6 +309,7 @@ export * from "./Acls/mutate/postVerificationEmailQuery.hook";
309
309
  export * from "./Acls/mutate/postVerificationUserQuery.hook";
310
310
  export * from "./Acls/mutate/updateDisabledVoucherTemplates.hook";
311
311
  export * from "./Acls/mutate/postCreateVoucherTemplates.hook";
312
+ export * from "./Acls/mutate/reactivateVoucherQuery.hook";
312
313
  export * from "./OSUA/get/documentos/getGngDocumentos.hook";
313
314
  export * from "./OSUA/get/documentos/getSitooDocumentos.hook";
314
315
  export * from "./OSUA/get/vouchers/getGngVoucher.hook";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.3.67",
3
+ "version": "0.3.68",
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,27 @@
1
+ import { useMutation, useQueryClient } from "@tanstack/react-query"
2
+ import { putWithParameters } from "../../../services/ApiService"
3
+ import { VoucherTemplates } from "../../../interfaces"
4
+
5
+ interface ReactivateVoucherProps {
6
+ voucherId: string;
7
+ userId: string;
8
+ }
9
+
10
+ export const reactivateVoucher = ({ voucherId, userId }: ReactivateVoucherProps) => {
11
+ const queryClient = useQueryClient()
12
+
13
+ return useMutation<{ Success: boolean }, unknown, void>(() =>
14
+ putWithParameters<{ Success: boolean }>(
15
+ `/ACUL/Vouchers/reactivate?`,
16
+ {
17
+ pUserId: userId,
18
+ pVoucherId: voucherId,
19
+ }
20
+ ),
21
+ {
22
+ onSuccess: (data: { Success: boolean }) => {
23
+ queryClient.setQueryData(["REACTIVATE_VOUCHER"], data)
24
+ },
25
+ }
26
+ )
27
+ }
@@ -353,6 +353,7 @@ export * from "./Acls/mutate/postVerificationEmailQuery.hook";
353
353
  export * from "./Acls/mutate/postVerificationUserQuery.hook";
354
354
  export * from "./Acls/mutate/updateDisabledVoucherTemplates.hook";
355
355
  export * from "./Acls/mutate/postCreateVoucherTemplates.hook";
356
+ export * from "./Acls/mutate/reactivateVoucherQuery.hook";
356
357
 
357
358
  //OSUA
358
359
  export * from "./OSUA/get/documentos/getGngDocumentos.hook";