link to form print

This commit is contained in:
hamid zarghami
2026-02-02 14:15:37 +03:30
parent 96186f3fa5
commit 024cd19b82
4 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
VITE_API_BASE_URL = 'http://10.24.161.1:4000' VITE_API_BASE_URL = 'http://10.86.60.88:4000'
VITE_TOKEN_NAME = 'negareh_at' VITE_TOKEN_NAME = 'negareh_at'
VITE_REFRESH_TOKEN_NAME = 'negareh_art' VITE_REFRESH_TOKEN_NAME = 'negareh_art'
+1
View File
@@ -78,5 +78,6 @@ export const Paths = {
list: '/print/list', list: '/print/list',
create: '/print/create', create: '/print/create',
update: '/print/update/', update: '/print/update/',
form: '/print/form/'
} }
} }
+1 -1
View File
@@ -33,7 +33,7 @@ const OrderDetail: FC = () => {
{ {
data?.data?.items?.map((item) => { data?.data?.items?.map((item) => {
return ( return (
<OrderItem estimatedDays={data?.data?.estimatedDays} item={item} /> <OrderItem key={item.id} estimatedDays={data?.data?.estimatedDays} item={item} />
) )
}) })
} }
+14 -1
View File
@@ -1,6 +1,9 @@
import { type FC } from 'react' import { type FC } from 'react'
import type { OrderItemType } from '../types/Types' import type { OrderItemType } from '../types/Types'
import { useGetEntityField } from '@/pages/formBuilder/hooks/useFormBuilderData' import { useGetEntityField } from '@/pages/formBuilder/hooks/useFormBuilderData'
import Button from '@/components/Button'
import { Link, useParams } from 'react-router-dom'
import { Paths } from '@/config/Paths'
type Props = { type Props = {
item: OrderItemType, item: OrderItemType,
@@ -9,11 +12,21 @@ type Props = {
const OrderItem: FC<Props> = ({ item, estimatedDays }) => { const OrderItem: FC<Props> = ({ item, estimatedDays }) => {
const { id } = useParams()
const { data: fields } = useGetEntityField(item.product?.id) const { data: fields } = useGetEntityField(item.product?.id)
return ( return (
<div key={item.product.id}> <div key={item.product.id} className='border border-border rounded-3xl p-6'>
<div className='flex items-center justify-between mb-4'>
<div>#{item.id}</div>
<Link to={Paths.print.form + item.id + `/${id}`}>
<Button
label='فرم پرینت'
className='w-fit px-6'
/>
</Link>
</div>
<div className="flex items-center gap-6"> <div className="flex items-center gap-6">
{/* Product Image */} {/* Product Image */}
<div className='size-[86px] rounded-lg overflow-hidden'> <div className='size-[86px] rounded-lg overflow-hidden'>