diff --git a/src/controllers/service/service-controller.ts b/src/controllers/service/service-controller.ts index 784736b..edba6d1 100644 --- a/src/controllers/service/service-controller.ts +++ b/src/controllers/service/service-controller.ts @@ -123,8 +123,9 @@ export class ServiceController extends Controller { where: { id: serviceId }, }); - if (!record) + if (!record) { throw new HttpError(HttpStatus.NOT_FOUND, "Service cannot be found.", "serviceNotFound"); + } return Object.assign(record, { imageUrl: await presignedGetObjectIfExist(MINIO_BUCKET, imageLocation(record.id), 60 * 60), @@ -209,7 +210,6 @@ export class ServiceController extends Controller { }, { isolationLevel: Prisma.TransactionIsolationLevel.Serializable }, ); - this.setStatus(HttpStatus.CREATED); return Object.assign(record, {