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:
@@ -27,6 +27,7 @@ export default async function RoutePage(props: PageParams<{ slug:string, project
|
|||||||
const project = await prisma.project.findUnique({
|
const project = await prisma.project.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: projectId,
|
id: projectId,
|
||||||
|
isArchived: {not: true}
|
||||||
},
|
},
|
||||||
include:{
|
include:{
|
||||||
databases: {}
|
databases: {}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ export default async function RoutePage(props: PageParams<{slug: string}>) {
|
|||||||
|
|
||||||
const projects = await prisma.project.findMany({
|
const projects = await prisma.project.findMany({
|
||||||
where: {
|
where: {
|
||||||
|
isArchived: {not: true},
|
||||||
|
|
||||||
organization: {
|
organization: {
|
||||||
slug: organizationSlug,
|
slug: organizationSlug,
|
||||||
// users: {
|
// users: {
|
||||||
|
|||||||
@@ -74,11 +74,13 @@ RUN adduser --system --uid 1001 nextjs
|
|||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|
||||||
RUN mkdir .next
|
RUN mkdir .next
|
||||||
|
RUN mkdir -p /app/private/uploads
|
||||||
|
RUN chown -R nextjs:nodejs /app/private
|
||||||
|
|
||||||
RUN chown nextjs:nodejs .next
|
RUN chown nextjs:nodejs .next
|
||||||
|
|
||||||
COPY --from=builder /app/next.config.mjs ./
|
COPY --from=builder /app/next.config.mjs ./
|
||||||
COPY --from=builder /app/schema.zmodel ./
|
COPY --from=builder /app/schema.zmodel ./
|
||||||
#COPY --from=builder /app/src/lib/hooks ./src/lib/hooks
|
|
||||||
COPY --from=builder /app/src/openapi.yaml ./src/
|
COPY --from=builder /app/src/openapi.yaml ./src/
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
npx install --save-dev @zenstackhq/openapi
|
echo " ____ __ __ "
|
||||||
|
echo " / __ \____ _____/ /_____ _/ /_ ____ _________ "
|
||||||
|
echo " / /_/ / __ \/ ___/ __/ __ / __ \/ __ / ___/ _ \ "
|
||||||
|
echo " / ____/ /_/ / / / /_/ /_/ / /_/ / /_/ (__ ) __/ "
|
||||||
|
echo " /_/ \____/_/ \__/\__,_/_.___/\__,_/____/\___/ "
|
||||||
|
echo " "
|
||||||
|
echo " Community Edition "
|
||||||
|
|
||||||
|
|
||||||
npx zenstack generate
|
|
||||||
npx prisma migrate deploy
|
npx prisma migrate deploy
|
||||||
node server.js
|
node server.js
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -16,10 +16,14 @@ export const ButtonDeleteProject = (props: ButtonDeleteProjectProps) => {
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const mutation = useMutation({
|
const mutation = useMutation({
|
||||||
mutationFn: () => deleteProjectAction(props.projectId),
|
mutationFn: () => deleteProjectAction(props.projectId),
|
||||||
onSuccess: async (result) => {
|
onSuccess: async (result: any) => {
|
||||||
router.push("/dashboard")
|
console.log(result)
|
||||||
if(result.data.success) {
|
if(result.data?.success) {
|
||||||
toast.success(result.data.actionSuccess.message);
|
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});
|
// export const db = enhance(prisma, {user: user});
|
||||||
|
|
||||||
import { enhance } from "@zenstackhq/runtime";
|
import {enhance} from "@zenstackhq/runtime";
|
||||||
import { prisma } from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
|
|
||||||
export const getDb = async () => {
|
export const getDb = async () => {
|
||||||
const { currentUser } = await import("@/auth/current-user");
|
const {currentUser} = await import("@/auth/current-user");
|
||||||
const user = await currentUser();
|
const user = await currentUser();
|
||||||
return enhance(prisma, { user });
|
return enhance(prisma, {user});
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user