mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
Fix assignment deletion and team removal
This update changes assignment deletion labels to prefer WO/IM names, adds a configurable payload to ConfirmDelete for non-DELETE API calls, and switches team member removal to a PUT endpoint with status REMOVED. It also shortens project autofill toast duration, cleans out stale commented code on the client detail page, and updates the task error badge wording to better reflect app-level failures.
This commit is contained in:
@@ -14,16 +14,17 @@ interface Props {
|
||||
title?: string
|
||||
description?: string,
|
||||
method?: any
|
||||
payload?: any
|
||||
}
|
||||
|
||||
export function ConfirmDelete({ endpoint, title, description, onSuccess, onCancel, method }: Props) {
|
||||
export function ConfirmDelete({ endpoint, title, description, onSuccess, onCancel, method, payload }: Props) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
const handleDelete = async () => {
|
||||
setIsLoading(true)
|
||||
const toastId = toast.loading('Deleting data...');
|
||||
try {
|
||||
const res = await serverApiCall(method || 'DELETE', endpoint!)
|
||||
const res = await serverApiCall(method || 'DELETE', endpoint!, payload)
|
||||
|
||||
if (res.success) {
|
||||
toast.success("Data deleted successfully ☺️", { id: toastId });
|
||||
|
||||
Reference in New Issue
Block a user