Sửa lỗi backend để chạy phần đăng ký

This commit is contained in:
2026-06-13 17:41:11 +07:00
parent c08aad3f68
commit 6913bbae48
70 changed files with 1296 additions and 210 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
import { NestFactory } from '@nestjs/core';
import { Module, Controller, Get, Post, Body, Param, ParseIntPipe, NotFoundException, BadRequestException } from '@nestjs/common';
import { PrismaService } from './prisma.service';
import { PrismaService } from './prisma.service.js';
import 'dotenv/config';
import * as bcrypt from 'bcrypt';
@@ -16,6 +16,12 @@ class AppController {
class AuthController {
constructor(private prisma: PrismaService) {}
@Get('status')
async getStatus() {
const userCount = await this.prisma.user.count();
return { isInitialSetup: userCount === 0 };
}
@Post('signup')
async signup(@Body() body: any) {
const { email, password, name } = body;