Skip to content

Commit 5f4d026

Browse files
authored
fix(server): check site deleting state in site creation (#997)
1 parent 3408aca commit 5f4d026

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/src/website/website.controller.ts

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { ApplicationAuthGuard } from 'src/auth/application.auth.guard'
2222
import { ResponseUtil } from 'src/utils/response'
2323
import { BundleService } from 'src/region/bundle.service'
2424
import { BucketService } from 'src/storage/bucket.service'
25+
import { DomainState } from '@prisma/client'
2526

2627
@ApiTags('WebsiteHosting')
2728
@ApiBearerAuth('Authorization')
@@ -61,6 +62,12 @@ export class WebsiteController {
6162
return ResponseUtil.error('bucket not found')
6263
}
6364

65+
if (bucket.websiteHosting?.state === DomainState.Deleted) {
66+
return ResponseUtil.error(
67+
'The previous website is deleting, please try again later.',
68+
)
69+
}
70+
6471
if (bucket.websiteHosting) {
6572
return ResponseUtil.error('bucket already binded as website hosting')
6673
}

0 commit comments

Comments
 (0)