add : tag batch update and delete
This commit is contained in:
@@ -77,6 +77,22 @@ export default function Tagging() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
<Tooltip title="ویرایش" position="right">
|
||||||
|
<Button
|
||||||
|
variant="edit"
|
||||||
|
page="livestock_farmers"
|
||||||
|
access="Edit-Rancher"
|
||||||
|
onClick={() => {
|
||||||
|
openModal({
|
||||||
|
title: "ایجاد پلاک جدید",
|
||||||
|
content: (
|
||||||
|
<SubmitNewTags getData={handleUpdate} item={item} />
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
|
||||||
<DeleteButtonForPopOver
|
<DeleteButtonForPopOver
|
||||||
page="tagging"
|
page="tagging"
|
||||||
access="Delete-Tag"
|
access="Delete-Tag"
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ export const SubmitNewTags = ({ getData, item }: SubmitNewTagsTypeProps) => {
|
|||||||
|
|
||||||
const { profile } = useUserProfileStore();
|
const { profile } = useUserProfileStore();
|
||||||
|
|
||||||
console.log(item);
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@@ -58,13 +56,15 @@ export const SubmitNewTags = ({ getData, item }: SubmitNewTagsTypeProps) => {
|
|||||||
defaultValues: {
|
defaultValues: {
|
||||||
country_code: 364,
|
country_code: 364,
|
||||||
static_code: 0,
|
static_code: 0,
|
||||||
species_code: 1,
|
serial_start: item?.serial_from || "",
|
||||||
|
serial_end: item?.serial_to || "",
|
||||||
|
species_code: item?.species_code || 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const mutation = useApiMutation({
|
const mutation = useApiMutation({
|
||||||
api: "/tag/web/api/v1/tag/",
|
api: `/tag/web/api/v1/tag/${item?.id ? item.id : ""}`,
|
||||||
method: "post",
|
method: item ? "put" : "post",
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSubmit = async (data: FormValues) => {
|
const onSubmit = async (data: FormValues) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user