From c4d994e89fbf74483aae3f78750d2c5d0b82abea Mon Sep 17 00:00:00 2001 From: maslow Date: Mon, 16 Jan 2023 20:36:46 +0800 Subject: [PATCH] fix(server): fix response check error in bucket-updating (#642) --- deploy/build/charts/laf-server/templates/deployment.yaml | 1 - server/src/storage/bucket.controller.ts | 6 +++--- server/src/storage/bucket.service.ts | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/deploy/build/charts/laf-server/templates/deployment.yaml b/deploy/build/charts/laf-server/templates/deployment.yaml index 3a534670..20b8ec0e 100644 --- a/deploy/build/charts/laf-server/templates/deployment.yaml +++ b/deploy/build/charts/laf-server/templates/deployment.yaml @@ -59,7 +59,6 @@ spec: value: {{ .Values.jwt.expires_in | quote}} - name: MINIO_DOMAIN value: {{ .Values.minio.domain }} - - name: MINIO_INTERNAL_ENDPOINT - name: MINIO_EXTERNAL_ENDPOINT value: {{ .Values.minio.external_endpoint }} - name: MINIO_INTERNAL_ENDPOINT diff --git a/server/src/storage/bucket.controller.ts b/server/src/storage/bucket.controller.ts index 57e47ab6..2b888780 100644 --- a/server/src/storage/bucket.controller.ts +++ b/server/src/storage/bucket.controller.ts @@ -92,7 +92,7 @@ export class BucketController { @Get(':name') async findOne(@Param('appid') appid: string, @Param('name') name: string) { const data = await this.bucketService.findOne(appid, name) - if (null === data) { + if (!data) { throw new HttpException('bucket not found', HttpStatus.NOT_FOUND) } return ResponseUtil.ok(data) @@ -120,7 +120,7 @@ export class BucketController { } const res = await this.bucketService.update(bucket, dto) - if (null === res) { + if (!res) { return ResponseUtil.error('update bucket failed') } return ResponseUtil.ok(res) @@ -143,7 +143,7 @@ export class BucketController { } const res = await this.bucketService.delete(bucket) - if (null === res) { + if (!res) { return ResponseUtil.error('delete bucket failed') } diff --git a/server/src/storage/bucket.service.ts b/server/src/storage/bucket.service.ts index 5d57f723..172de86e 100644 --- a/server/src/storage/bucket.service.ts +++ b/server/src/storage/bucket.service.ts @@ -86,7 +86,7 @@ export class BucketService { bucket.name, dto.policy, ) - if (out.$metadata.httpStatusCode !== 200) { + if (out.$metadata.httpStatusCode !== 204) { this.logger.error('update bucket in minio failed: ', out) return false }