From dc2397d73e5a6b17d0833efa84af8e4ebb1b3012 Mon Sep 17 00:00:00 2001 From: Ly Tuan Kiet Date: Tue, 26 Nov 2024 00:42:51 +0700 Subject: [PATCH] Refactor WorkshopSchema: remove imageFileUrl field and update resolver parameters for consistency --- src/Workshop/workshop.schema.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Workshop/workshop.schema.ts b/src/Workshop/workshop.schema.ts index b6d2290..e6c36c8 100644 --- a/src/Workshop/workshop.schema.ts +++ b/src/Workshop/workshop.schema.ts @@ -45,9 +45,6 @@ export class WorkshopSchema extends PothosSchema { imageFileId: t.exposeID('imageFileId', { description: 'The ID of the image file for the workshop.', }), - imageFileUrl: t.exposeString('imageFileUrl', { - description: 'The URL of the image file for the workshop.', - }), date: t.expose('date', { type: 'DateTime', nullable: true, @@ -90,7 +87,7 @@ export class WorkshopSchema extends PothosSchema { type: this.workshop(), args: this.builder.generator.findUniqueArgs('Workshop'), description: 'Retrieve a single workshop by its unique identifier.', - resolve: async (query, root, args, ctx, info) => { + resolve: async (query, _root, args, _ctx, _info) => { return await this.prisma.workshop.findUnique({ ...query, where: args.where, @@ -103,7 +100,7 @@ export class WorkshopSchema extends PothosSchema { args: this.builder.generator.findManyArgs('Workshop'), description: 'Retrieve a list of workshops with optional filtering, ordering, and pagination.', - resolve: async (query, root, args, ctx, info) => { + resolve: async (query, _root, args, _ctx, _info) => { return await this.prisma.workshop.findMany({ ...query, skip: args.skip ?? undefined, @@ -126,7 +123,7 @@ export class WorkshopSchema extends PothosSchema { }), }, description: 'Create a new workshop.', - resolve: async (query, root, args, ctx, info) => { + resolve: async (query, _root, args, _ctx, _info) => { return await this.prisma.workshop.create({ ...query, data: args.input, @@ -147,7 +144,7 @@ export class WorkshopSchema extends PothosSchema { }), }, description: 'Update an existing workshop.', - resolve: async (query, root, args, ctx, info) => { + resolve: async (query, _root, args, _ctx, _info) => { return await this.prisma.workshop.update({ ...query, where: args.where,