fix: (docker images)

changed check-db.mjs to output number in stdout
changed routes.ts to import prisma with relative paths
This commit is contained in:
Charly Gley
2025-05-05 21:04:14 +02:00
parent 37a30f1bd7
commit 1a0b565ae0
3 changed files with 8 additions and 5 deletions

View File

@@ -2,7 +2,10 @@ import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {}
async function main() {
const count = await prisma.user.count();
console.log(count);
}
main()
.catch((e) => {
@@ -11,4 +14,4 @@ main()
})
.finally(async () => {
await prisma.$disconnect();
});
});

View File

@@ -1,4 +1,4 @@
import { prisma } from "shared/prisma";
import { prisma } from "../../shared/prisma";
import { AppController } from "./controller";
import { ConfigResponseSchema, BulkUpdateConfigSchema } from "./dto";
import { FastifyInstance } from "fastify";

View File

@@ -1,4 +1,4 @@
import { prisma } from "shared/prisma";
import { prisma } from "../../shared/prisma";
import { createPasswordSchema } from "../auth/dto";
import { UserController } from "./controller";
import { UpdateUserSchema, UserResponseSchema } from "./dto";
@@ -13,7 +13,7 @@ export async function userRoutes(app: FastifyInstance) {
try {
const usersCount = await prisma.user.count();
if (usersCount > 0 ) {
if (usersCount > 0) {
await request.jwtVerify();
if (!request.user.isAdmin) {
return reply