修复下载单文件订阅

This commit is contained in:
whyour
2024-06-06 22:40:51 +08:00
parent 1e749f3731
commit c3908e956f
9 changed files with 46 additions and 25 deletions
+4 -1
View File
@@ -63,7 +63,10 @@ export default class CronViewService {
query: FindOptions<CrontabView>['where'],
): Promise<CrontabView> {
const doc: any = await CrontabViewModel.findOne({ where: { ...query } });
return doc && (doc.get({ plain: true }) as CrontabView);
if (!doc) {
throw new Error(`${JSON.stringify(query)} not found`);
}
return doc.get({ plain: true });
}
public async disabled(ids: number[]) {