chore: history projectId

This commit is contained in:
xiaojunnuo
2026-02-11 18:17:46 +08:00
parent 638a7f0ab4
commit 99db1b1cc3
2 changed files with 7 additions and 8 deletions

View File

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

View File

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