fix(server): fix response check error in bucket-updating (#642)

This commit is contained in:
maslow 2023-01-16 20:36:46 +08:00 committed by GitHub
parent f6e2c3572d
commit c4d994e89f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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')
}

View File

@ -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
}