Compare commits
No commits in common. "772cf2a253f418c990b9e96171422bbb7811b798" and "74b67d1e2cddf4f2bfafdb2a70f50ca16d6bc705" have entirely different histories.
772cf2a253
...
74b67d1e2c
@ -21,8 +21,7 @@ export const useCustomerSummaryPanelController = ({
|
|||||||
defaultVisibility: initialOpen ? "visible" : "hidden",
|
defaultVisibility: initialOpen ? "visible" : "hidden",
|
||||||
});
|
});
|
||||||
|
|
||||||
const query = useCustomerGetQuery({
|
const query = useCustomerGetQuery(customerId, {
|
||||||
id: customerId,
|
|
||||||
enabled: Boolean(customerId),
|
enabled: Boolean(customerId),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
|
import type { CriteriaDTO } from "@erp/core";
|
||||||
import { useDebounce } from "@repo/rdx-ui/components";
|
import { useDebounce } from "@repo/rdx-ui/components";
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
|
|
||||||
import { type ListCustomersByCriteriaParams, useCustomersListQuery } from "../../shared";
|
import { useCustomersListQuery } from "../../shared";
|
||||||
|
|
||||||
export const useListCustomersController = () => {
|
export const useListCustomersController = () => {
|
||||||
const [pageIndex, setPageIndex] = useState(0);
|
const [pageIndex, setPageIndex] = useState(0);
|
||||||
@ -10,17 +11,15 @@ export const useListCustomersController = () => {
|
|||||||
|
|
||||||
const debouncedQ = useDebounce(search, 300);
|
const debouncedQ = useDebounce(search, 300);
|
||||||
|
|
||||||
const criteria = useMemo<NonNullable<ListCustomersByCriteriaParams["criteria"]>>(
|
const criteria = useMemo<CriteriaDTO>(() => {
|
||||||
() => ({
|
return {
|
||||||
q: debouncedQ || "",
|
q: debouncedQ || "",
|
||||||
pageNumber: pageIndex,
|
|
||||||
pageSize,
|
pageSize,
|
||||||
|
pageNumber: pageIndex,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
orderBy: "name",
|
orderBy: "name",
|
||||||
//filters: statusFilter === "all" ? [] : [{ field: "status", operator: "eq", value: statusFilter }],
|
};
|
||||||
}),
|
}, [pageSize, pageIndex, debouncedQ]);
|
||||||
[debouncedQ, pageIndex, pageSize /*statusFilter*/]
|
|
||||||
);
|
|
||||||
|
|
||||||
const query = useCustomersListQuery({ criteria });
|
const query = useCustomersListQuery({ criteria });
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,37 @@
|
|||||||
import {
|
import { MetadataSchema } from "@erp/core";
|
||||||
type GetSupplierByIdResponseDTO,
|
import { z } from "zod/v4";
|
||||||
GetSupplierByIdResponseSchema,
|
|
||||||
} from "./get-supplier-by-id.response.dto";
|
|
||||||
|
|
||||||
export const UpdateSupplierByIdResponseSchema = GetSupplierByIdResponseSchema;
|
export const UpdateSupplierByIdResponseSchema = z.object({
|
||||||
export type UpdateSupplierByIdResponseDTO = GetSupplierByIdResponseDTO;
|
id: z.uuid(),
|
||||||
|
company_id: z.uuid(),
|
||||||
|
reference: z.string(),
|
||||||
|
|
||||||
|
is_company: z.string(),
|
||||||
|
name: z.string(),
|
||||||
|
trade_name: z.string(),
|
||||||
|
tin: z.string(),
|
||||||
|
|
||||||
|
street: z.string(),
|
||||||
|
street2: z.string(),
|
||||||
|
city: z.string(),
|
||||||
|
province: z.string(),
|
||||||
|
postal_code: z.string(),
|
||||||
|
country: z.string(),
|
||||||
|
|
||||||
|
email_primary: z.string(),
|
||||||
|
email_secondary: z.string(),
|
||||||
|
phone_primary: z.string(),
|
||||||
|
phone_secondary: z.string(),
|
||||||
|
mobile_primary: z.string(),
|
||||||
|
mobile_secondary: z.string(),
|
||||||
|
|
||||||
|
fax: z.string(),
|
||||||
|
website: z.string(),
|
||||||
|
|
||||||
|
language_code: z.string(),
|
||||||
|
currency_code: z.string(),
|
||||||
|
|
||||||
|
metadata: MetadataSchema.optional(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type UpdateSupplierByIdResponseDTO = z.infer<typeof UpdateSupplierByIdResponseSchema>;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user