add : tag batch update and delete
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user