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

Function removeUser

src/components/UsersTable.tsx:288–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286 ];
287
288 async function removeUser() {
289 if (selectedUser) {
290 const res = await api
291 .delete(`/org/${org!.org.orgId}/user/${selectedUser.id}`)
292 .catch((e) => {
293 toast({
294 variant: "destructive",
295 title: t("userErrorOrgRemove"),
296 description: formatAxiosError(
297 e,
298 t("userErrorOrgRemoveDescription")
299 )
300 });
301 });
302
303 if (res && res.status === 200) {
304 toast({
305 variant: "default",
306 title: t("userOrgRemoved"),
307 description: t("userOrgRemovedDescription", {
308 email: selectedUser.email || ""
309 })
310 });
311 }
312 }
313 router.refresh();
314 setIsDeleteModalOpen(false);
315 }
316
317 function toggleSort(column: string) {
318 const newSearch = getNextSortOrder(column, searchParams);

Callers

nothing calls this directly

Calls 2

toastFunction · 0.90
formatAxiosErrorFunction · 0.90

Tested by

no test coverage detected