MCPcopy
hub / github.com/fosrl/pangolin / deleteSite

Function deleteSite

src/components/OrgApiKeysTable.tsx:69–90  ·  view source on GitHub ↗
(apiKeyId: string)

Source from the content-addressed store, hash-verified

67 };
68
69 const deleteSite = (apiKeyId: string) => {
70 api.delete(`/org/${orgId}/api-key/${apiKeyId}`)
71 .catch((e) => {
72 console.error(t("apiKeysErrorDelete"), e);
73 toast({
74 variant: "destructive",
75 title: t("apiKeysErrorDelete"),
76 description: formatAxiosError(
77 e,
78 t("apiKeysErrorDeleteMessage")
79 )
80 });
81 })
82 .then(() => {
83 router.refresh();
84 setIsDeleteModalOpen(false);
85
86 const newRows = rows.filter((row) => row.id !== apiKeyId);
87
88 setRows(newRows);
89 });
90 };
91
92 const columns: ExtendedColumnDef<OrgApiKeyRow>[] = [
93 {

Callers 1

OrgApiKeysTableFunction · 0.70

Calls 2

toastFunction · 0.90
formatAxiosErrorFunction · 0.90

Tested by

no test coverage detected