@portnet/ui 5.0.20 → 5.0.22

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.
@@ -37,7 +37,7 @@ const reclamationApi = axiosInstance => ({
37
37
  throw (error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || new Error("Impossible de charger les réclamations");
38
38
  }
39
39
  },
40
- createReclamationApi: async data => {
40
+ createReclamationApi: async (data, portailId) => {
41
41
  try {
42
42
  const formData = new FormData();
43
43
  const serviceConcerne = data.service.codigo;
@@ -50,7 +50,11 @@ const reclamationApi = axiosInstance => ({
50
50
  formData.append("files", file);
51
51
  });
52
52
  }
53
- const response = await axiosInstance.post("/reclamation/create", formData, {
53
+ const url = "/reclamation/create";
54
+ if (portailId) {
55
+ formData.append("portailId", portailId);
56
+ }
57
+ const response = await axiosInstance.post(url, formData, {
54
58
  headers: {
55
59
  "Content-Type": "multipart/form-data"
56
60
  }
@@ -1267,7 +1267,7 @@ const ReclamationFormModal = _ref4 => {
1267
1267
  const {
1268
1268
  mutate: createReclamation,
1269
1269
  isLoading
1270
- } = (0, _useReclamation.useCreateReclamation)();
1270
+ } = (0, _useReclamation.useCreateReclamation)(portailId);
1271
1271
  const {
1272
1272
  data: listServiceReclamation,
1273
1273
  isFetching: isFetchingListServiceReclamation
@@ -24,13 +24,13 @@ const useListReclamation = (page, search) => {
24
24
  });
25
25
  };
26
26
  exports.useListReclamation = useListReclamation;
27
- const useCreateReclamation = () => {
27
+ const useCreateReclamation = portailId => {
28
28
  const {
29
29
  reclamationApi
30
30
  } = (0, _PuiHelpWidgetContext.useHelpWidget)();
31
31
  const queryClient = (0, _reactQuery.useQueryClient)();
32
32
  return (0, _reactQuery.useMutation)({
33
- mutationFn: data => reclamationApi.createReclamationApi(data),
33
+ mutationFn: data => reclamationApi.createReclamationApi(data, portailId),
34
34
  onSuccess: data => {
35
35
  queryClient.invalidateQueries("get_list_reclamation");
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portnet/ui",
3
- "version": "5.0.20",
3
+ "version": "5.0.22",
4
4
  "description": "Portnet UI",
5
5
  "keywords": [
6
6
  "react",