修复订阅自动增加/删除任务默认值

This commit is contained in:
whyour
2023-02-14 11:07:16 +08:00
parent 7bce5c4f6a
commit 622fe2a8f8
3 changed files with 17 additions and 7 deletions
+4 -5
View File
@@ -1,4 +1,5 @@
import { Subscription } from '../data/subscription';
import isNil from 'lodash/isNil';
export function formatUrl(doc: Subscription) {
let url = doc.url;
@@ -33,11 +34,9 @@ export function formatCommand(doc: Subscription, url?: string) {
if (type === 'file') {
command += `raw "${_url}"`;
} else {
command += `repo "${_url}" "${whitelist || ''}" "${blacklist || ''}" "${
dependences || ''
}" "${branch || ''}" "${extensions || ''}" "${proxy || ''}" "${
Boolean(autoAddCron) ?? ''
}" "${Boolean(autoDelCron) ?? ''}"`;
command += `repo "${_url}" "${whitelist || ''}" "${blacklist || ''}" "${dependences || ''
}" "${branch || ''}" "${extensions || ''}" "${proxy || ''}" "${isNil(autoAddCron) ? true : Boolean(autoAddCron)
}" "${isNil(autoDelCron) ? true : Boolean(autoDelCron)}"`;
}
return command;
}
+1 -1
View File
@@ -68,7 +68,7 @@ export default class SubscriptionService {
['createdAt', 'DESC'],
],
});
return result as any;
return result;
} catch (error) {
throw error;
}