formbuilder

This commit is contained in:
hamid zarghami
2026-01-29 10:24:41 +03:30
parent 2234c44202
commit f9899f108c
6 changed files with 48 additions and 30 deletions
+9 -9
View File
@@ -3,20 +3,20 @@ import { Paths } from '@/config/Paths'
import { AddSquare, Edit } from 'iconsax-react'
import { type FC } from 'react'
import { Link, useParams } from 'react-router-dom'
import { useDeleteAttribute, useGetAttributes } from '../hooks/useProductData'
import { useDeleteField, useGetFields } from './hooks/useFormBuilderData'
import Table from '@/components/Table'
import TrashWithConfrim from '@/components/TrashWithConfrim'
import { toast } from 'react-toastify'
import { extractErrorMessage } from '@/config/func'
const AttributeList: FC = () => {
const FormBuilderList: FC = () => {
const { id } = useParams()
const { mutate: deleteAttribute, isPending } = useDeleteAttribute()
const { data, refetch } = useGetAttributes(Number(id))
const { mutate: deleteField, isPending } = useDeleteField()
const { data, refetch } = useGetFields(Number(id))
const handleDelete = (id: number) => {
deleteAttribute(id, {
deleteField(id, {
onSuccess: () => {
refetch()
},
@@ -33,7 +33,7 @@ const AttributeList: FC = () => {
<h1 className='text-lg font-light'>ویژگی ها</h1>
<Link
to={Paths.product.attribute.create + id}
to={Paths.formBuilder.create + id}
>
<Button
className='w-fit px-6'
@@ -71,7 +71,7 @@ const AttributeList: FC = () => {
title: 'مقادیر',
render: (item) => {
return (
<Link to={Paths.product.attributeValue.list + item.id}>
<Link to={Paths.formBuilder.list + item.id}>
<Button className='w-fit px-5'>
میدیریت مقادیر
</Button>
@@ -85,7 +85,7 @@ const AttributeList: FC = () => {
render: (item) => {
return (
<div className='flex gap-2 items-center'>
<Link to={Paths.product.attribute.update + item.id}>
<Link to={Paths.formBuilder.update + item.id}>
<Edit
color='#0037FF'
size={20}
@@ -110,4 +110,4 @@ const AttributeList: FC = () => {
)
}
export default AttributeList
export default FormBuilderList