mirror of
https://github.com/SrIzan10/api.git
synced 2026-06-06 00:46:48 +00:00
fix: prisma generate
This commit is contained in:
3
index.ts
3
index.ts
@@ -6,9 +6,12 @@ import { router } from "express-file-routing"
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { PrismaClient } from "@prisma/client"
|
||||
const exec = (await import('util')).promisify((await import('child_process')).exec);
|
||||
|
||||
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
await exec('npx prisma generate')
|
||||
|
||||
/* MongoDB */
|
||||
export const prisma = new PrismaClient()
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
"express": "^4.18.1",
|
||||
"express-file-routing": "^3.0.3",
|
||||
"express-rate-limit": "^6.6.0",
|
||||
"mongoose": "^6.6.5"
|
||||
"mongoose": "^6.6.5",
|
||||
"prisma": "^5.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.13",
|
||||
"@types/express": "^4.17.14",
|
||||
"prisma": "^5.4.2",
|
||||
"typescript": "^4.8.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Handler } from "express"
|
||||
import { prisma } from "../../index.js"
|
||||
|
||||
export const get: Handler = async (req, res) => {
|
||||
if (!req.query.msgid) return res.status(400).json({ error: "msgid is required" })
|
||||
if (!req.query.msgid) return res.status(400).json({ error: "msgid is required" })
|
||||
if (await prisma.transcripts.count({ where: { msgid: req.query.msgid as string } }) === 0)
|
||||
return res.status(400).json({
|
||||
error: "the message doesn't exist",
|
||||
|
||||
Reference in New Issue
Block a user