mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
patch delete organization.
This commit is contained in:
+5
-1
@@ -6,6 +6,7 @@ import {
|
||||
import {useMutation} from "@tanstack/react-query";
|
||||
import {setCurrentOrganizationSlug} from "@/features/dashboard/organization-cookie";
|
||||
import {useRouter} from "next/navigation";
|
||||
import {toast} from "sonner";
|
||||
|
||||
export type DeleteOrganizationButtonProps = {
|
||||
organizationSlug: string;
|
||||
@@ -19,7 +20,10 @@ export const DeleteOrganizationButton = (props: DeleteOrganizationButtonProps) =
|
||||
console.log(result);
|
||||
if(result.data.success) {
|
||||
await setCurrentOrganizationSlug("default")
|
||||
router.push("/dashboard")
|
||||
router.push("/")
|
||||
toast.success(result.data.actionSuccess.message);
|
||||
}else{
|
||||
toast.error(result.data.actionError.message);
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -181,7 +181,7 @@ export const deleteOrganizationAction = userAction
|
||||
console.log(organization);
|
||||
const organizationUpdated = await db.organization.update({
|
||||
where: {
|
||||
id: parsedInput,
|
||||
slug: parsedInput,
|
||||
},
|
||||
data: {
|
||||
name: `${organization.name}-${uuid}`,
|
||||
|
||||
Reference in New Issue
Block a user