@zauru-sdk/utils 2.25.2 → 2.25.4
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.
|
@@ -165,7 +165,7 @@ export const updatePurchaseItemPrice = async (headers, data, purchase_id) => {
|
|
|
165
165
|
},
|
|
166
166
|
};
|
|
167
167
|
const responseUpdate = await updateReceivedPurchaseOrder(headers, body, purchase_id);
|
|
168
|
-
if (responseUpdate.error) {
|
|
168
|
+
if (responseUpdate.error || responseUpdate.data === null) {
|
|
169
169
|
throw new Error(responseUpdate.userMsg);
|
|
170
170
|
}
|
|
171
171
|
return true;
|
|
@@ -187,7 +187,10 @@ export const updateOchAndDis = async (headers, data, purchase_id) => {
|
|
|
187
187
|
if (data.other_charges) {
|
|
188
188
|
body.purchase_order.other_charges = Number(data.other_charges);
|
|
189
189
|
}
|
|
190
|
-
await updateReceivedPurchaseOrder(headers, body, purchase_id);
|
|
190
|
+
const responseUpdate = await updateReceivedPurchaseOrder(headers, body, purchase_id);
|
|
191
|
+
if (responseUpdate.error || responseUpdate.data === null) {
|
|
192
|
+
throw new Error(responseUpdate.userMsg);
|
|
193
|
+
}
|
|
191
194
|
return true;
|
|
192
195
|
});
|
|
193
196
|
};
|
|
@@ -272,7 +275,10 @@ export const updatePurchaseOrderReception = async (headers, data, purchase_id) =
|
|
|
272
275
|
purchase_order_details_attributes: data.purchase_order_details_attributes,
|
|
273
276
|
},
|
|
274
277
|
};
|
|
275
|
-
await updateReceivedPurchaseOrder(headers, body, purchase_id);
|
|
278
|
+
const responseUpdate = await updateReceivedPurchaseOrder(headers, body, purchase_id);
|
|
279
|
+
if (responseUpdate.error || responseUpdate.data === null) {
|
|
280
|
+
throw new Error(responseUpdate.userMsg);
|
|
281
|
+
}
|
|
276
282
|
return true;
|
|
277
283
|
});
|
|
278
284
|
};
|
|
@@ -372,7 +378,8 @@ export const createNewLabItemRequest = (headers, session, body) => {
|
|
|
372
378
|
};
|
|
373
379
|
const response = await createNewPurchaseOrder(headers, sendBody);
|
|
374
380
|
if (!response.data || response.error) {
|
|
375
|
-
throw new Error("Ocurrió un error al crear la recepción de insumos: " +
|
|
381
|
+
throw new Error("Ocurrió un error al crear la recepción de insumos: " +
|
|
382
|
+
response.userMsg);
|
|
376
383
|
}
|
|
377
384
|
return response.data;
|
|
378
385
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/utils",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.4",
|
|
4
4
|
"description": "Utilidades, parseo de request y demás para desarrollo de webapps de Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@remix-run/node": "^2.8.1",
|
|
27
27
|
"@zauru-sdk/common": "^2.16.1",
|
|
28
28
|
"@zauru-sdk/config": "^2.23.1",
|
|
29
|
-
"@zauru-sdk/graphql": "^2.25.
|
|
30
|
-
"@zauru-sdk/services": "^2.25.
|
|
29
|
+
"@zauru-sdk/graphql": "^2.25.3",
|
|
30
|
+
"@zauru-sdk/services": "^2.25.3",
|
|
31
31
|
"@zauru-sdk/types": "^2.16.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "19a2838f82c18b911b8900c7e618cbd2537c836a"
|
|
34
34
|
}
|