erp-pos-ecommerce-shared 0.2.1 → 0.2.3
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.
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +3 -2
- package/dist/hooks.js +37 -2
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +37 -2
- package/dist/index.js.map +1 -1
- package/dist/queries.d.ts +2 -2
- package/dist/queries.js +29 -1
- package/dist/queries.js.map +1 -1
- package/dist/services.d.ts +2 -1
- package/dist/services.js +14 -2
- package/dist/services.js.map +1 -1
- package/dist/{shift.queries-ul2JnMAU.d.ts → shift.queries-BbWWhwdp.d.ts} +1 -0
- package/package.json +1 -1
package/dist/queries.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { QueryClient, UseMutationOptions } from '@tanstack/react-query';
|
|
|
5
5
|
import { b as IAttributeQueryParams, c as IAttributeResponse, I as IAttribute, d as IAttributeValue, h as ICategoryResponse, g as ICategory, f as IBatchResponse, e as IBatch } from './filters.interface-glhGBJfx.js';
|
|
6
6
|
import { aA as UserResponse, $ as IUser, A as AgentResponse, a0 as IUserForm, a2 as IWareHouseResponse, a1 as IWareHouse, k as IClientResponse, l as IClientResponseById, h as IClient, j as IClientRequest, g as IBankTerminalResponse, d as IBankTerminal, a as BankTerminalResponse, e as IBankTerminalForm, U as IRole, O as IProviderResponse, L as IProvider, M as IProviderForSelect, N as IProviderRequest, o as ILocationResponse, n as ILocation, p as IMaterial, G as IPriceTypeResponse, F as IPriceType, z as IPermissionRole, a8 as PermissionRole, J as IPromotionResponse, H as IPromotion, K as IPromotionType, x as IPaymentMethod, y as IPaymentMethodAmountExpected, w as IPayment, Z as ITax, r as IModule, Y as ITag, ab as PricePerGramResponse, E as IPricePerGramHistory, az as UpdatePriceRequest, ag as SchedulePriceRequest, a9 as PriceCalculationResponse, C as CalculatePriceRequest, c as ComparisonBy, V as IStockByWarehouseReport, R as IReportX, P as IReportComparisonByTimeFrame, Q as IReportInventory, S as IReportZ, ak as TblOrderDetail, X as IStockMovementResponse, W as IStockMovement } from './warehouse.interface-fnr42ygU.js';
|
|
7
7
|
import { W as WarehouseResponse, U as UpdateBatchData, L as LocationResponse, M as MaterialResponse, b as IExchangeResponse, I as IExchange, P as PaymentType, c as IUpdatePermission, d as LoginResponse, S as StateResponse, e as PrintQRResponse, G as GetReturnsByOrderIdResponse } from './warehouse.service-CDDl5yeV.js';
|
|
8
|
-
import { F as FolioResponse } from './shift.queries-
|
|
9
|
-
export { C as CloseShiftData, G as GenderResponse, H as HealthCheckResponse, P as ProductQueryParams, U as UseOrdersParams, g as genderQueryKeys, a as genders, h as health, b as healthQueryKeys, o as orderQueryKeys, c as orders, p as productQueryKeys, d as products, s as shifts } from './shift.queries-
|
|
8
|
+
import { F as FolioResponse } from './shift.queries-BbWWhwdp.js';
|
|
9
|
+
export { C as CloseShiftData, G as GenderResponse, H as HealthCheckResponse, P as ProductQueryParams, U as UseOrdersParams, g as genderQueryKeys, a as genders, h as health, b as healthQueryKeys, o as orderQueryKeys, c as orders, p as productQueryKeys, d as products, s as shifts } from './shift.queries-BbWWhwdp.js';
|
|
10
10
|
import '@tanstack/react-table';
|
|
11
11
|
|
|
12
12
|
declare const attributeQueryKeys: {
|
package/dist/queries.js
CHANGED
|
@@ -66,7 +66,11 @@ var getAttributeValues = async ({
|
|
|
66
66
|
var createAttribute = async ({
|
|
67
67
|
attribute
|
|
68
68
|
}) => {
|
|
69
|
-
const { data } = await api.post("/attribute",
|
|
69
|
+
const { data } = await api.post("/attribute", {
|
|
70
|
+
name: attribute.name,
|
|
71
|
+
values: attribute.values,
|
|
72
|
+
productID: attribute.productId
|
|
73
|
+
});
|
|
70
74
|
return data;
|
|
71
75
|
};
|
|
72
76
|
var createAttributesValuesBatch = async ({
|
|
@@ -2168,6 +2172,14 @@ var createProductVariant = async (variant) => {
|
|
|
2168
2172
|
});
|
|
2169
2173
|
return data;
|
|
2170
2174
|
};
|
|
2175
|
+
var createProductVariants = async (formData) => {
|
|
2176
|
+
const { data } = await api.post("product/variants", formData, {
|
|
2177
|
+
headers: {
|
|
2178
|
+
"Content-Type": "multipart/form-data"
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
return data;
|
|
2182
|
+
};
|
|
2171
2183
|
var updateProductVariant = async (data) => {
|
|
2172
2184
|
const { data: response } = await api.put(
|
|
2173
2185
|
`product/variants/update/${data.get("productDetailID")}`,
|
|
@@ -2370,6 +2382,22 @@ var products = {
|
|
|
2370
2382
|
});
|
|
2371
2383
|
}
|
|
2372
2384
|
}),
|
|
2385
|
+
createProductVariants: (queryClient) => ({
|
|
2386
|
+
mutationFn: createProductVariants,
|
|
2387
|
+
onSuccess: () => {
|
|
2388
|
+
queryClient.invalidateQueries({ queryKey: productQueryKeys.all });
|
|
2389
|
+
successNotification({
|
|
2390
|
+
title: "Variantes creadas",
|
|
2391
|
+
message: "Las variantes se han creado correctamente."
|
|
2392
|
+
});
|
|
2393
|
+
},
|
|
2394
|
+
onError: (error) => {
|
|
2395
|
+
errorNotification({
|
|
2396
|
+
title: "Error",
|
|
2397
|
+
message: error.message || "No se pudieron crear las variantes."
|
|
2398
|
+
});
|
|
2399
|
+
}
|
|
2400
|
+
}),
|
|
2373
2401
|
updateProductVariant: (queryClient) => ({
|
|
2374
2402
|
mutationFn: updateProductVariant,
|
|
2375
2403
|
onSuccess: () => {
|