mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +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 })
|
@Post('/list', { summary: Constants.per.authOnly })
|
||||||
async list(@Body(ALL) body) {
|
async list(@Body(ALL) body) {
|
||||||
const { projectId, userId } = await this.getProjectUserIdRead()
|
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);
|
const isAdmin = this.authService.isAdmin(this.ctx);
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
|
|||||||
@@ -258,13 +258,7 @@ export class PipelineController extends CrudController<PipelineService> {
|
|||||||
|
|
||||||
@Post('/refreshWebhookKey', { summary: Constants.per.authOnly })
|
@Post('/refreshWebhookKey', { summary: Constants.per.authOnly })
|
||||||
async refreshWebhookKey(@Body('id') id: number) {
|
async refreshWebhookKey(@Body('id') id: number) {
|
||||||
|
await this.checkEntityOwner(this.getService(), id,"write");
|
||||||
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);
|
|
||||||
}
|
|
||||||
const res = await this.service.refreshWebhookKey(id);
|
const res = await this.service.refreshWebhookKey(id);
|
||||||
return this.ok({
|
return this.ok({
|
||||||
webhookKey: res,
|
webhookKey: res,
|
||||||
|
|||||||
Reference in New Issue
Block a user