mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Patching some bugs.
This commit is contained in:
+7
-3
@@ -16,10 +16,14 @@ export const ButtonDeleteProject = (props: ButtonDeleteProjectProps) => {
|
||||
const router = useRouter()
|
||||
const mutation = useMutation({
|
||||
mutationFn: () => deleteProjectAction(props.projectId),
|
||||
onSuccess: async (result) => {
|
||||
router.push("/dashboard")
|
||||
if(result.data.success) {
|
||||
onSuccess: async (result: any) => {
|
||||
console.log(result)
|
||||
if(result.data?.success) {
|
||||
toast.success(result.data.actionSuccess.message);
|
||||
router.push("/")
|
||||
|
||||
}else{
|
||||
toast.error(result.data.actionError.message || "Unknown error occurred.");
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
//
|
||||
// export const db = enhance(prisma, {user: user});
|
||||
|
||||
import { enhance } from "@zenstackhq/runtime";
|
||||
import { prisma } from "@/prisma";
|
||||
import {enhance} from "@zenstackhq/runtime";
|
||||
import {prisma} from "@/prisma";
|
||||
|
||||
export const getDb = async () => {
|
||||
const { currentUser } = await import("@/auth/current-user");
|
||||
const {currentUser} = await import("@/auth/current-user");
|
||||
const user = await currentUser();
|
||||
return enhance(prisma, { user });
|
||||
return enhance(prisma, {user});
|
||||
};
|
||||
Reference in New Issue
Block a user