mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-23 06:11:58 +00:00
v2.0.0-beta.3 (#30)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
@@ -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";
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user