add : tag batch update and delete

This commit is contained in:
2026-01-19 20:04:14 +03:30
parent 2e8a74bb9c
commit b573a16e89
2 changed files with 21 additions and 5 deletions

View File

@@ -77,6 +77,22 @@ export default function Tagging() {
}}
/>
</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
page="tagging"
access="Delete-Tag"

View File

@@ -45,8 +45,6 @@ export const SubmitNewTags = ({ getData, item }: SubmitNewTagsTypeProps) => {
const { profile } = useUserProfileStore();
console.log(item);
const {
control,
handleSubmit,
@@ -58,13 +56,15 @@ export const SubmitNewTags = ({ getData, item }: SubmitNewTagsTypeProps) => {
defaultValues: {
country_code: 364,
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({
api: "/tag/web/api/v1/tag/",
method: "post",
api: `/tag/web/api/v1/tag/${item?.id ? item.id : ""}`,
method: item ? "put" : "post",
});
const onSubmit = async (data: FormValues) => {