warqadui 0.0.290 → 0.0.291
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/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -3
- package/dist/index.mjs +17 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1795,15 +1795,18 @@ declare const createProductSchema: z$1.ZodObject<{
|
|
|
1795
1795
|
brand: z$1.ZodOptional<z$1.ZodString>;
|
|
1796
1796
|
cost: z$1.ZodNumber;
|
|
1797
1797
|
yard: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1798
|
+
branch: z$1.ZodOptional<z$1.ZodString>;
|
|
1798
1799
|
}, "strip", z$1.ZodTypeAny, {
|
|
1799
1800
|
name: string;
|
|
1800
1801
|
cost: number;
|
|
1802
|
+
branch?: string | undefined;
|
|
1801
1803
|
category?: string | undefined;
|
|
1802
1804
|
brand?: string | undefined;
|
|
1803
1805
|
yard?: number | undefined;
|
|
1804
1806
|
}, {
|
|
1805
1807
|
name: string;
|
|
1806
1808
|
cost: number;
|
|
1809
|
+
branch?: string | undefined;
|
|
1807
1810
|
category?: string | undefined;
|
|
1808
1811
|
brand?: string | undefined;
|
|
1809
1812
|
yard?: number | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1795,15 +1795,18 @@ declare const createProductSchema: z$1.ZodObject<{
|
|
|
1795
1795
|
brand: z$1.ZodOptional<z$1.ZodString>;
|
|
1796
1796
|
cost: z$1.ZodNumber;
|
|
1797
1797
|
yard: z$1.ZodOptional<z$1.ZodNumber>;
|
|
1798
|
+
branch: z$1.ZodOptional<z$1.ZodString>;
|
|
1798
1799
|
}, "strip", z$1.ZodTypeAny, {
|
|
1799
1800
|
name: string;
|
|
1800
1801
|
cost: number;
|
|
1802
|
+
branch?: string | undefined;
|
|
1801
1803
|
category?: string | undefined;
|
|
1802
1804
|
brand?: string | undefined;
|
|
1803
1805
|
yard?: number | undefined;
|
|
1804
1806
|
}, {
|
|
1805
1807
|
name: string;
|
|
1806
1808
|
cost: number;
|
|
1809
|
+
branch?: string | undefined;
|
|
1807
1810
|
category?: string | undefined;
|
|
1808
1811
|
brand?: string | undefined;
|
|
1809
1812
|
yard?: number | undefined;
|
package/dist/index.js
CHANGED
|
@@ -20138,9 +20138,10 @@ var UpdateImage_default = UpdateImage;
|
|
|
20138
20138
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
20139
20139
|
function Products({ v, url }) {
|
|
20140
20140
|
const [deleteProduct, setDeleteProduct] = (0, import_react64.useState)(null);
|
|
20141
|
+
const { branchId } = (0, import_react_router_dom24.useParams)();
|
|
20141
20142
|
const { isLoading, remove } = useApis_default();
|
|
20142
20143
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
20143
|
-
url: url || `/products/get`,
|
|
20144
|
+
url: url || `/products/get${branchId ? "?branch=" + branchId : ""}`,
|
|
20144
20145
|
v,
|
|
20145
20146
|
dateFilter: false
|
|
20146
20147
|
});
|
|
@@ -20280,7 +20281,8 @@ var createProductSchema = import_zod25.z.object({
|
|
|
20280
20281
|
category: import_zod25.z.string().optional(),
|
|
20281
20282
|
brand: import_zod25.z.string().optional(),
|
|
20282
20283
|
cost: import_zod25.z.number({ message: "Cost is required" }).min(0),
|
|
20283
|
-
yard: import_zod25.z.coerce.number().optional()
|
|
20284
|
+
yard: import_zod25.z.coerce.number().optional(),
|
|
20285
|
+
branch: import_zod25.z.string().optional()
|
|
20284
20286
|
});
|
|
20285
20287
|
|
|
20286
20288
|
// src/components/products/ProductForm.tsx
|
|
@@ -20303,7 +20305,8 @@ function ProductForm() {
|
|
|
20303
20305
|
category: void 0,
|
|
20304
20306
|
brand: void 0,
|
|
20305
20307
|
cost: 0,
|
|
20306
|
-
yard: void 0
|
|
20308
|
+
yard: void 0,
|
|
20309
|
+
branch: void 0
|
|
20307
20310
|
},
|
|
20308
20311
|
shouldUnregister: false
|
|
20309
20312
|
});
|
|
@@ -20416,6 +20419,16 @@ function ProductForm() {
|
|
|
20416
20419
|
api: "/brands/get"
|
|
20417
20420
|
}
|
|
20418
20421
|
),
|
|
20422
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
20423
|
+
Feilds_default.Branches,
|
|
20424
|
+
{
|
|
20425
|
+
label: "Branch",
|
|
20426
|
+
form: methods,
|
|
20427
|
+
name: "branch",
|
|
20428
|
+
placeholder: "Select Branch",
|
|
20429
|
+
api: "/branches/get?noStore=true"
|
|
20430
|
+
}
|
|
20431
|
+
),
|
|
20419
20432
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
20420
20433
|
Fields_default.Input,
|
|
20421
20434
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -20115,7 +20115,7 @@ var CategoryField = {
|
|
|
20115
20115
|
var Feilds_default4 = CategoryField;
|
|
20116
20116
|
|
|
20117
20117
|
// src/components/products/Products.tsx
|
|
20118
|
-
import { useNavigate as useNavigate14 } from "react-router-dom";
|
|
20118
|
+
import { useNavigate as useNavigate14, useParams as useParams15 } from "react-router-dom";
|
|
20119
20119
|
import { EllipsisVertical as EllipsisVertical8, FilePenLine as FilePenLine7, Image as Image3, Trash2 as Trash210 } from "lucide-react";
|
|
20120
20120
|
import { useState as useState42 } from "react";
|
|
20121
20121
|
import { message as message30 } from "antd";
|
|
@@ -20224,9 +20224,10 @@ var UpdateImage_default = UpdateImage;
|
|
|
20224
20224
|
import { Fragment as Fragment46, jsx as jsx114, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
20225
20225
|
function Products({ v, url }) {
|
|
20226
20226
|
const [deleteProduct, setDeleteProduct] = useState42(null);
|
|
20227
|
+
const { branchId } = useParams15();
|
|
20227
20228
|
const { isLoading, remove } = useApis_default();
|
|
20228
20229
|
const { data, TransactionViewComponent, reload } = useTransaction_default({
|
|
20229
|
-
url: url || `/products/get`,
|
|
20230
|
+
url: url || `/products/get${branchId ? "?branch=" + branchId : ""}`,
|
|
20230
20231
|
v,
|
|
20231
20232
|
dateFilter: false
|
|
20232
20233
|
});
|
|
@@ -20366,7 +20367,8 @@ var createProductSchema = z11.object({
|
|
|
20366
20367
|
category: z11.string().optional(),
|
|
20367
20368
|
brand: z11.string().optional(),
|
|
20368
20369
|
cost: z11.number({ message: "Cost is required" }).min(0),
|
|
20369
|
-
yard: z11.coerce.number().optional()
|
|
20370
|
+
yard: z11.coerce.number().optional(),
|
|
20371
|
+
branch: z11.string().optional()
|
|
20370
20372
|
});
|
|
20371
20373
|
|
|
20372
20374
|
// src/components/products/ProductForm.tsx
|
|
@@ -20389,7 +20391,8 @@ function ProductForm() {
|
|
|
20389
20391
|
category: void 0,
|
|
20390
20392
|
brand: void 0,
|
|
20391
20393
|
cost: 0,
|
|
20392
|
-
yard: void 0
|
|
20394
|
+
yard: void 0,
|
|
20395
|
+
branch: void 0
|
|
20393
20396
|
},
|
|
20394
20397
|
shouldUnregister: false
|
|
20395
20398
|
});
|
|
@@ -20502,6 +20505,16 @@ function ProductForm() {
|
|
|
20502
20505
|
api: "/brands/get"
|
|
20503
20506
|
}
|
|
20504
20507
|
),
|
|
20508
|
+
/* @__PURE__ */ jsx115(
|
|
20509
|
+
Feilds_default.Branches,
|
|
20510
|
+
{
|
|
20511
|
+
label: "Branch",
|
|
20512
|
+
form: methods,
|
|
20513
|
+
name: "branch",
|
|
20514
|
+
placeholder: "Select Branch",
|
|
20515
|
+
api: "/branches/get?noStore=true"
|
|
20516
|
+
}
|
|
20517
|
+
),
|
|
20505
20518
|
/* @__PURE__ */ jsx115(
|
|
20506
20519
|
Fields_default.Input,
|
|
20507
20520
|
{
|