chore: update Node version and enhance debugging capabilities

- Removed .nvmrc file to eliminate version locking.
- Updated Dockerfile to use Node 22.6.0-alpine for improved performance and security.
- Modified package.json to enhance the 'start:dev' script with debugging options.
- Added new launch configuration in VSCode for attaching to Node processes by PID.
- Cleaned up settings.json by removing unused configurations.
- Refactored main.ts to simplify the bootstrap process.
- Enhanced logging in OrderSchema and ScheduleSchema for better traceability of operations.
This commit is contained in:
2024-12-03 22:46:23 +07:00
parent 951d61f3ac
commit a516dce800
8 changed files with 27 additions and 16 deletions

View File

@@ -262,6 +262,7 @@ export class ScheduleSchema extends PothosSchema {
if (!ctx.http?.me?.id) {
throw new Error('User not found')
}
Logger.log(`ctx.http.me.role: ${ctx.http.me.role}`)
// use case 1: customer query schedules where customer is participant
if (ctx.http.me.role === Role.CUSTOMER) {
const schedules = await this.prisma.schedule.findMany({
@@ -286,6 +287,7 @@ export class ScheduleSchema extends PothosSchema {
if (!center) {
throw new Error('Center not found')
}
// get all schedules belong to center
const schedules = await this.prisma.schedule.findMany({
...query,
skip: args.skip ?? undefined,