mirror of
https://github.com/certd/certd.git
synced 2026-07-25 04:57:34 +08:00
fix: 修复正常批量删除流水线报权限不足的bug
This commit is contained in:
@@ -253,7 +253,6 @@ export abstract class BaseService<T> {
|
||||
if (!Array.isArray(ids)) {
|
||||
ids = [ids];
|
||||
}
|
||||
ids = this.filterIds(ids);
|
||||
const res = await this.getRepository().find({
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
@@ -266,7 +265,7 @@ export abstract class BaseService<T> {
|
||||
},
|
||||
});
|
||||
if (!res || res.length === ids.length) {
|
||||
return;
|
||||
return ids;
|
||||
}
|
||||
throw new PermissionException("权限不足");
|
||||
}
|
||||
@@ -280,6 +279,12 @@ export abstract class BaseService<T> {
|
||||
});
|
||||
}
|
||||
async batchDelete(ids: number[], userId: number, projectId?: number): Promise<number> {
|
||||
if (!ids || ids.length === 0) {
|
||||
throw new ValidateException("ids不能为空");
|
||||
}
|
||||
if (!Array.isArray(ids)) {
|
||||
ids = [ids];
|
||||
}
|
||||
ids = this.filterIds(ids);
|
||||
if (userId != null) {
|
||||
const userProjectQuery = this.buildUserProjectQuery(userId, projectId);
|
||||
|
||||
Reference in New Issue
Block a user