修复下载单文件订阅

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
+5 -2
View File
@@ -26,7 +26,7 @@ export default class OpenService {
public async insert(payload: App): Promise<App> {
const doc = await AppModel.create(payload, { returning: true });
return doc.get({ plain: true }) as App;
return doc.get({ plain: true });
}
public async update(payload: App): Promise<App> {
@@ -45,7 +45,10 @@ export default class OpenService {
public async getDb(query: any): Promise<App> {
const doc: any = await AppModel.findOne({ where: query });
return doc && (doc.get({ plain: true }) as App);
if (!doc) {
throw new Error(`${JSON.stringify(query)} not found`);
}
return doc.get({ plain: true });
}
public async remove(ids: number[]) {