@fctc/interface-logic 2.2.8 → 2.2.10

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.
@@ -146,7 +146,12 @@ declare function useFormService(): {
146
146
  uploadFile: ({ formData }: {
147
147
  formData: any;
148
148
  }) => Promise<any>;
149
- getFile: (idFile: number, context: any) => Promise<any>;
149
+ saveFile: ({ model, idForm, idFile, context, }: {
150
+ model: string;
151
+ idForm: any;
152
+ idFile: any;
153
+ context: any;
154
+ }) => Promise<any>;
150
155
  };
151
156
 
152
157
  type TGetGroupsParams = {
@@ -146,7 +146,12 @@ declare function useFormService(): {
146
146
  uploadFile: ({ formData }: {
147
147
  formData: any;
148
148
  }) => Promise<any>;
149
- getFile: (idFile: number, context: any) => Promise<any>;
149
+ saveFile: ({ model, idForm, idFile, context, }: {
150
+ model: string;
151
+ idForm: any;
152
+ idFile: any;
153
+ context: any;
154
+ }) => Promise<any>;
150
155
  };
151
156
 
152
157
  type TGetGroupsParams = {
package/dist/services.js CHANGED
@@ -2938,7 +2938,7 @@ var import_react_query31 = require("@tanstack/react-query");
2938
2938
  // src/hooks/form/use-upload-file.ts
2939
2939
  var import_react_query32 = require("@tanstack/react-query");
2940
2940
 
2941
- // src/hooks/form/use-get-file.ts
2941
+ // src/hooks/form/use-save-file.ts
2942
2942
  var import_react_query33 = require("@tanstack/react-query");
2943
2943
 
2944
2944
  // src/hooks/model/use-delete.ts
@@ -3749,21 +3749,28 @@ function useFormService() {
3749
3749
  },
3750
3750
  [env]
3751
3751
  );
3752
- const getFile = (0, import_react10.useCallback)(
3753
- async (idFile, context) => {
3752
+ const saveFile = (0, import_react10.useCallback)(
3753
+ async ({
3754
+ model,
3755
+ idForm,
3756
+ idFile,
3757
+ context
3758
+ }) => {
3754
3759
  const jsonData = {
3755
- model: "ir.attachment",
3756
- method: "web_read" /* WEB_READ */,
3757
- ids: [idFile],
3758
- with_context: context,
3759
- kwargs: {
3760
- specification: {
3761
- name: {},
3762
- mimetype: {}
3760
+ model,
3761
+ method: "web_save" /* WEB_SAVE */,
3762
+ ids: [
3763
+ [idForm],
3764
+ {
3765
+ attachment_ids: [[4, idFile]]
3763
3766
  }
3767
+ ],
3768
+ kwargs: {
3769
+ context,
3770
+ specification: {}
3764
3771
  }
3765
3772
  };
3766
- return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3773
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3767
3774
  headers: {
3768
3775
  "Content-Type": "application/json"
3769
3776
  }
@@ -3825,7 +3832,7 @@ function useFormService() {
3825
3832
  getFormView,
3826
3833
  changeStatus,
3827
3834
  uploadFile,
3828
- getFile
3835
+ saveFile
3829
3836
  };
3830
3837
  }
3831
3838
 
package/dist/services.mjs CHANGED
@@ -2894,119 +2894,119 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
2894
2894
  // src/hooks/form/use-upload-file.ts
2895
2895
  import { useMutation as useMutation25 } from "@tanstack/react-query";
2896
2896
 
2897
- // src/hooks/form/use-get-file.ts
2898
- import { useQuery as useQuery6 } from "@tanstack/react-query";
2897
+ // src/hooks/form/use-save-file.ts
2898
+ import { useMutation as useMutation26 } from "@tanstack/react-query";
2899
2899
 
2900
2900
  // src/hooks/model/use-delete.ts
2901
- import { useMutation as useMutation26 } from "@tanstack/react-query";
2901
+ import { useMutation as useMutation27 } from "@tanstack/react-query";
2902
2902
 
2903
2903
  // src/hooks/model/use-get-all.ts
2904
- import { useQuery as useQuery7 } from "@tanstack/react-query";
2904
+ import { useQuery as useQuery6 } from "@tanstack/react-query";
2905
2905
 
2906
2906
  // src/hooks/model/use-get-conversion-rate.ts
2907
- import { useQuery as useQuery8 } from "@tanstack/react-query";
2907
+ import { useQuery as useQuery7 } from "@tanstack/react-query";
2908
2908
 
2909
2909
  // src/hooks/model/use-get-currency.ts
2910
- import { useQuery as useQuery9 } from "@tanstack/react-query";
2910
+ import { useQuery as useQuery8 } from "@tanstack/react-query";
2911
2911
 
2912
2912
  // src/hooks/model/use-get-detail.ts
2913
- import { useMutation as useMutation27 } from "@tanstack/react-query";
2913
+ import { useMutation as useMutation28 } from "@tanstack/react-query";
2914
2914
 
2915
2915
  // src/hooks/model/use-get-field-onchange.ts
2916
- import { useQuery as useQuery10 } from "@tanstack/react-query";
2916
+ import { useQuery as useQuery9 } from "@tanstack/react-query";
2917
2917
 
2918
2918
  // src/hooks/model/use-get-list-my-bank-account.ts
2919
- import { useQuery as useQuery11 } from "@tanstack/react-query";
2919
+ import { useQuery as useQuery10 } from "@tanstack/react-query";
2920
2920
 
2921
2921
  // src/hooks/model/use-onchange-form.ts
2922
- import { useMutation as useMutation28 } from "@tanstack/react-query";
2922
+ import { useMutation as useMutation29 } from "@tanstack/react-query";
2923
2923
 
2924
2924
  // src/hooks/model/use-save.ts
2925
- import { useMutation as useMutation29 } from "@tanstack/react-query";
2925
+ import { useMutation as useMutation30 } from "@tanstack/react-query";
2926
2926
 
2927
2927
  // src/hooks/user/use-get-profile.ts
2928
- import { useMutation as useMutation30 } from "@tanstack/react-query";
2928
+ import { useMutation as useMutation31 } from "@tanstack/react-query";
2929
2929
 
2930
2930
  // src/hooks/user/use-get-user.ts
2931
- import { useMutation as useMutation31 } from "@tanstack/react-query";
2931
+ import { useMutation as useMutation32 } from "@tanstack/react-query";
2932
2932
 
2933
2933
  // src/hooks/user/use-switch-locale.ts
2934
- import { useMutation as useMutation32 } from "@tanstack/react-query";
2934
+ import { useMutation as useMutation33 } from "@tanstack/react-query";
2935
2935
 
2936
2936
  // src/hooks/view/use-button.ts
2937
- import { useMutation as useMutation33 } from "@tanstack/react-query";
2937
+ import { useMutation as useMutation34 } from "@tanstack/react-query";
2938
2938
 
2939
2939
  // src/hooks/view/use-duplicate-record.ts
2940
- import { useMutation as useMutation34 } from "@tanstack/react-query";
2940
+ import { useMutation as useMutation35 } from "@tanstack/react-query";
2941
2941
 
2942
2942
  // src/hooks/view/use-get-action-detail.ts
2943
- import { useQuery as useQuery12 } from "@tanstack/react-query";
2943
+ import { useQuery as useQuery11 } from "@tanstack/react-query";
2944
2944
 
2945
2945
  // src/hooks/view/use-get-calendar.ts
2946
- import { useQuery as useQuery13 } from "@tanstack/react-query";
2946
+ import { useQuery as useQuery12 } from "@tanstack/react-query";
2947
2947
 
2948
2948
  // src/hooks/view/use-get-groups.ts
2949
- import { useQuery as useQuery14 } from "@tanstack/react-query";
2949
+ import { useQuery as useQuery13 } from "@tanstack/react-query";
2950
2950
 
2951
2951
  // src/hooks/view/use-get-list-data.ts
2952
- import { useQuery as useQuery15 } from "@tanstack/react-query";
2952
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
2953
2953
 
2954
2954
  // src/hooks/view/use-get-menu.ts
2955
- import { useQuery as useQuery16 } from "@tanstack/react-query";
2955
+ import { useQuery as useQuery15 } from "@tanstack/react-query";
2956
2956
 
2957
2957
  // src/hooks/view/use-get-print-report.ts
2958
- import { useMutation as useMutation35 } from "@tanstack/react-query";
2958
+ import { useMutation as useMutation36 } from "@tanstack/react-query";
2959
2959
 
2960
2960
  // src/hooks/view/use-get-progress-bar.ts
2961
- import { useQuery as useQuery17 } from "@tanstack/react-query";
2961
+ import { useQuery as useQuery16 } from "@tanstack/react-query";
2962
2962
 
2963
2963
  // src/hooks/view/use-get-selection.ts
2964
- import { useQuery as useQuery18 } from "@tanstack/react-query";
2964
+ import { useQuery as useQuery17 } from "@tanstack/react-query";
2965
2965
 
2966
2966
  // src/hooks/view/use-get-view.ts
2967
- import { useQuery as useQuery19 } from "@tanstack/react-query";
2967
+ import { useQuery as useQuery18 } from "@tanstack/react-query";
2968
2968
 
2969
2969
  // src/hooks/view/use-load-action.ts
2970
- import { useMutation as useMutation36 } from "@tanstack/react-query";
2970
+ import { useMutation as useMutation37 } from "@tanstack/react-query";
2971
2971
 
2972
2972
  // src/hooks/view/use-load-message.ts
2973
- import { useQuery as useQuery20 } from "@tanstack/react-query";
2973
+ import { useQuery as useQuery19 } from "@tanstack/react-query";
2974
2974
 
2975
2975
  // src/hooks/view/use-print.ts
2976
- import { useMutation as useMutation37 } from "@tanstack/react-query";
2976
+ import { useMutation as useMutation38 } from "@tanstack/react-query";
2977
2977
 
2978
2978
  // src/hooks/view/use-remove-row.ts
2979
- import { useMutation as useMutation38 } from "@tanstack/react-query";
2979
+ import { useMutation as useMutation39 } from "@tanstack/react-query";
2980
2980
 
2981
2981
  // src/hooks/view/use-resequence.ts
2982
- import { useQuery as useQuery21 } from "@tanstack/react-query";
2982
+ import { useQuery as useQuery20 } from "@tanstack/react-query";
2983
2983
 
2984
2984
  // src/hooks/view/use-run-action.ts
2985
- import { useMutation as useMutation39 } from "@tanstack/react-query";
2985
+ import { useMutation as useMutation40 } from "@tanstack/react-query";
2986
2986
 
2987
2987
  // src/hooks/view/use-signin-sso.ts
2988
- import { useMutation as useMutation40 } from "@tanstack/react-query";
2988
+ import { useMutation as useMutation41 } from "@tanstack/react-query";
2989
2989
 
2990
2990
  // src/hooks/view/use-verify-2FA.ts
2991
- import { useMutation as useMutation41 } from "@tanstack/react-query";
2991
+ import { useMutation as useMutation42 } from "@tanstack/react-query";
2992
2992
 
2993
2993
  // src/hooks/view/uset-get-2FA-method.ts
2994
- import { useMutation as useMutation42 } from "@tanstack/react-query";
2994
+ import { useMutation as useMutation43 } from "@tanstack/react-query";
2995
2995
 
2996
2996
  // src/hooks/view/use-grant-access.ts
2997
- import { useMutation as useMutation43 } from "@tanstack/react-query";
2997
+ import { useMutation as useMutation44 } from "@tanstack/react-query";
2998
2998
 
2999
2999
  // src/hooks/view/use-remove-totp-setup.ts
3000
- import { useMutation as useMutation44 } from "@tanstack/react-query";
3000
+ import { useMutation as useMutation45 } from "@tanstack/react-query";
3001
3001
 
3002
3002
  // src/hooks/view/use-request-setup-totp.ts
3003
- import { useMutation as useMutation45 } from "@tanstack/react-query";
3003
+ import { useMutation as useMutation46 } from "@tanstack/react-query";
3004
3004
 
3005
3005
  // src/hooks/view/use-settings-web-read-2fa.ts
3006
- import { useMutation as useMutation46 } from "@tanstack/react-query";
3006
+ import { useMutation as useMutation47 } from "@tanstack/react-query";
3007
3007
 
3008
3008
  // src/hooks/view/use-verify-totp.ts
3009
- import { useMutation as useMutation47 } from "@tanstack/react-query";
3009
+ import { useMutation as useMutation48 } from "@tanstack/react-query";
3010
3010
 
3011
3011
  // src/provider/service-provider.tsx
3012
3012
  import { jsx as jsx6 } from "react/jsx-runtime";
@@ -3705,21 +3705,28 @@ function useFormService() {
3705
3705
  },
3706
3706
  [env]
3707
3707
  );
3708
- const getFile = useCallback6(
3709
- async (idFile, context) => {
3708
+ const saveFile = useCallback6(
3709
+ async ({
3710
+ model,
3711
+ idForm,
3712
+ idFile,
3713
+ context
3714
+ }) => {
3710
3715
  const jsonData = {
3711
- model: "ir.attachment",
3712
- method: "web_read" /* WEB_READ */,
3713
- ids: [idFile],
3714
- with_context: context,
3715
- kwargs: {
3716
- specification: {
3717
- name: {},
3718
- mimetype: {}
3716
+ model,
3717
+ method: "web_save" /* WEB_SAVE */,
3718
+ ids: [
3719
+ [idForm],
3720
+ {
3721
+ attachment_ids: [[4, idFile]]
3719
3722
  }
3723
+ ],
3724
+ kwargs: {
3725
+ context,
3726
+ specification: {}
3720
3727
  }
3721
3728
  };
3722
- return env?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3729
+ return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3723
3730
  headers: {
3724
3731
  "Content-Type": "application/json"
3725
3732
  }
@@ -3781,7 +3788,7 @@ function useFormService() {
3781
3788
  getFormView,
3782
3789
  changeStatus,
3783
3790
  uploadFile,
3784
- getFile
3791
+ saveFile
3785
3792
  };
3786
3793
  }
3787
3794
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "2.2.8",
3
+ "version": "2.2.10",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",