This commit is contained in:
Rizky 2024-06-28 00:25:38 +07:00
parent 904585868a
commit 332061d5d0
4 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,7 @@ export const _ = {
try { try {
const result = await execQuery(body, g.db); const result = await execQuery(body, g.db);
res.send(result); return result;
} catch (e: any) { } catch (e: any) {
console.log("_dbs error", body, e.message); console.log("_dbs error", body, e.message);
res.sendStatus(500); res.sendStatus(500);

View File

@ -109,6 +109,7 @@ export const _ = {
try { try {
await $({ cwd: dir("app/db") })`bun install`; await $({ cwd: dir("app/db") })`bun install`;
await $({})`cp -f .env app/db`;
await $({ cwd: dir("app/db") })`bun prisma db pull --force`; await $({ cwd: dir("app/db") })`bun prisma db pull --force`;
await $({ cwd: dir("app/db") })`bun prisma generate`; await $({ cwd: dir("app/db") })`bun prisma generate`;
await Bun.write( await Bun.write(

View File

@ -39,6 +39,7 @@ if (process.env.DATABASE_URL) {
if (!(await existsAsync(dir("node_modules/.prisma")))) { if (!(await existsAsync(dir("node_modules/.prisma")))) {
try { try {
await $({ cwd: dir(`app/db`) })`bun install`; await $({ cwd: dir(`app/db`) })`bun install`;
await $({ })`cp -f .env app/db`;
await $({ cwd: dir(`app/db`) })`bun prisma db pull --force`; await $({ cwd: dir(`app/db`) })`bun prisma db pull --force`;
await $({ cwd: dir(`app/db`) })`bun prisma generate`; await $({ cwd: dir(`app/db`) })`bun prisma generate`;
} catch (e) { } catch (e) {

View File

@ -62,6 +62,7 @@ export const createResponse = (
let content: any = typeof body === "string" ? body : JSON.stringify(body); let content: any = typeof body === "string" ? body : JSON.stringify(body);
const headers = { ...(opt?.headers || {}) } as Record<string, string>; const headers = { ...(opt?.headers || {}) } as Record<string, string>;
if (opt?.cache_accept) { if (opt?.cache_accept) {
let cached = false; let cached = false;
if ( if (