update unlist when delete

This commit is contained in:
Admin 2025-08-18 09:02:56 +07:00
parent 84111c08f8
commit 0fbe29af54
1 changed files with 10 additions and 5 deletions

View File

@ -62,6 +62,16 @@ export default function List() {
const { user } = useAppSelector((state: RootState) => state.app);
const handleDelete = async (data: IProduct) => {
if (data.status) {
const response = await productApi.customAction(
data.id || 0,
"unlist",
data
);
if (!response || !response?.data) return;
}
const result = await productApi.delete(data);
if (!result) return;
@ -395,11 +405,6 @@ export default function List() {
</ProductModal>
);
}}
options={{
disableDel(data) {
return data.id === user?.id;
},
}}
/>
</div>
</CardContent>