= (props) => {
)}>
{
attributes?.map((item) => {
- const value = formik.values.printAttributes?.find(o => o.fieldId === item.id)
+ const value = fields.find(o => o.fieldId === item.id)
if (item?.type === FieldTypeEnum.select)
return (
diff --git a/src/pages/print/hooks/usePrintData.ts b/src/pages/print/hooks/usePrintData.ts
index 10e669e..200ed7f 100644
--- a/src/pages/print/hooks/usePrintData.ts
+++ b/src/pages/print/hooks/usePrintData.ts
@@ -9,7 +9,7 @@ export const useGetSections = () => {
});
};
-export const useGetSectionsDetail = (id: number) => {
+export const useGetSectionsDetail = (id: string) => {
return useQuery({
queryKey: ["section", id],
queryFn: () => api.getSectionDetail(id),
@@ -31,7 +31,7 @@ export const useCreateSection = () => {
export const useUpdateSection = () => {
const queryClient = useQueryClient();
return useMutation({
- mutationFn: ({ id, params }: { id: number; params: CreateSectionType }) =>
+ mutationFn: ({ id, params }: { id: string; params: CreateSectionType }) =>
api.updateSection(id, params),
onSuccess: (_, params) => {
queryClient.refetchQueries({
@@ -47,7 +47,7 @@ export const useUpdateSection = () => {
export const useDeleteSection = () => {
const queryClient = useQueryClient();
return useMutation({
- mutationFn: (id: number) => api.deleteSection(id),
+ mutationFn: (id: string) => api.deleteSection(id),
onSuccess: () => {
queryClient.refetchQueries({
queryKey: ["sections"],
diff --git a/src/pages/print/service/PrintService.ts b/src/pages/print/service/PrintService.ts
index 152af08..1b6a5a8 100644
--- a/src/pages/print/service/PrintService.ts
+++ b/src/pages/print/service/PrintService.ts
@@ -16,19 +16,19 @@ export const createSection = async (params: CreateSectionType) => {
return data;
};
-export const updateSection = async (id: number, params: CreateSectionType) => {
+export const updateSection = async (id: string, params: CreateSectionType) => {
const { data } = await axios.patch(`/admin/section/${id}`, params);
return data;
};
-export const getSectionDetail = async (id: number) => {
+export const getSectionDetail = async (id: string) => {
const { data } = await axios.get(
`/admin/section/${id}`,
);
return data;
};
-export const deleteSection = async (id: number) => {
+export const deleteSection = async (id: string) => {
const { data } = await axios.delete(`/admin/section/${id}`);
return data;
};
diff --git a/src/router/MainRouter.tsx b/src/router/MainRouter.tsx
index f8d0d20..253b9bf 100644
--- a/src/router/MainRouter.tsx
+++ b/src/router/MainRouter.tsx
@@ -48,6 +48,7 @@ import CreateAdmin from "@/pages/admin/Create";
import EditAdmin from "@/pages/admin/Update";
import RequestDetail from "@/pages/requests/Detail";
import ConvertToOrders from "@/pages/order/ConvertToOrders";
+import OrderPrint from "@/pages/order/Print";
const MainRouter: FC = () => {
return (
@@ -89,6 +90,7 @@ const MainRouter: FC = () => {
} />
} />
} />
+ } />
} />
} />