mirror of
https://github.com/certd/certd.git
synced 2026-04-15 21:40:53 +08:00
chore: history projectId
This commit is contained in:
@@ -89,7 +89,12 @@ export class HistoryController extends CrudController<HistoryService> {
|
||||
@Post('/list', { summary: Constants.per.authOnly })
|
||||
async list(@Body(ALL) body) {
|
||||
const { projectId, userId } = await this.getProjectUserIdRead()
|
||||
body.query.projectId = projectId
|
||||
if (!body){
|
||||
body = {}
|
||||
}
|
||||
if (projectId){
|
||||
body.projectId = projectId
|
||||
}
|
||||
|
||||
const isAdmin = this.authService.isAdmin(this.ctx);
|
||||
if (!isAdmin) {
|
||||
|
||||
@@ -258,13 +258,7 @@ export class PipelineController extends CrudController<PipelineService> {
|
||||
|
||||
@Post('/refreshWebhookKey', { summary: Constants.per.authOnly })
|
||||
async refreshWebhookKey(@Body('id') id: number) {
|
||||
|
||||
const { projectId } = await this.getProjectUserIdWrite()
|
||||
if (projectId) {
|
||||
await this.authService.checkEntityProjectId(this.getService(), projectId, id);
|
||||
} else {
|
||||
await this.authService.checkEntityUserId(this.ctx, this.getService(), id);
|
||||
}
|
||||
await this.checkEntityOwner(this.getService(), id,"write");
|
||||
const res = await this.service.refreshWebhookKey(id);
|
||||
return this.ok({
|
||||
webhookKey: res,
|
||||
|
||||
Reference in New Issue
Block a user