修复删除日志命令

This commit is contained in:
whyour
2024-08-24 22:43:09 +08:00
parent 4e5ad6d5f3
commit 8b042d90f3
5 changed files with 47 additions and 42 deletions
+6 -2
View File
@@ -41,8 +41,12 @@ export default class SubscriptionService {
private crontabService: CrontabService,
) {}
public async list(searchText?: string): Promise<Subscription[]> {
public async list(
searchText?: string,
ids?: string,
): Promise<Subscription[]> {
let query = {};
const subIds = JSON.parse(ids || '[]');
if (searchText) {
const reg = {
[Op.or]: [
@@ -63,7 +67,7 @@ export default class SubscriptionService {
}
try {
const result = await SubscriptionModel.findAll({
where: query,
where: { ...query, ...(ids ? { id: subIds } : undefined) },
order: [
['is_disabled', 'ASC'],
['createdAt', 'DESC'],