updated build add update delete

This commit is contained in:
2025-12-02 17:13:25 +03:00
parent 0394d42d02
commit 5bb6021102
87 changed files with 1470 additions and 1158 deletions

View File

@@ -14,12 +14,12 @@ const fetchGraphQlUsersList = async (params: ListArguments): Promise<UsersListRe
} catch (error) { console.error('Error fetching test data:', error); throw error }
};
const fetchGraphQlDeleteUser = async (uuid: string): Promise<boolean> => {
const fetchGraphQlDeleteUser = async (uuid: string, refetchTable: () => void): Promise<boolean> => {
console.log('Fetching test data from local API');
try {
const res = await fetch(`/api/users/delete?uuid=${uuid}`, { method: 'GET', cache: 'no-store', credentials: "include" });
if (!res.ok) { const errorText = await res.text(); console.error('Test data API error:', errorText); throw new Error(`API error: ${res.status} ${res.statusText}`) }
const data = await res.json();
const data = await res.json(); refetchTable()
return data
} catch (error) { console.error('Error fetching test data:', error); throw error }
};
@@ -30,7 +30,7 @@ export function useGraphQlUsersList(params: ListArguments) {
export function useDeleteUserMutation() {
return useMutation({
mutationFn: ({ uuid }: { uuid: string }) => fetchGraphQlDeleteUser(uuid),
mutationFn: ({ uuid, refetchTable }: { uuid: string, refetchTable: () => void }) => fetchGraphQlDeleteUser(uuid, refetchTable),
onSuccess: () => { console.log("User deleted successfully") },
onError: (error) => { console.error("Delete user failed:", error) },
})

View File

@@ -35,11 +35,6 @@ function getColumns(appendBuildID: (id: string) => void, removeBuildID: (id: str
header: "Token",
cell: ({ getValue }) => getValue(),
},
{
accessorKey: "collectionToken",
header: "Collection Token",
cell: ({ getValue }) => getValue(),
},
{
accessorKey: "info.govAddressCode",
header: "Gov Address Code",