refactor: rewrite get-apps queries with RQ

This commit is contained in:
Rıdvan Akca
2024-03-06 14:36:37 +03:00
parent be62c09d06
commit c0cc6cc176
6 changed files with 48 additions and 290 deletions

View File

@@ -1,17 +0,0 @@
import App from '../../models/app.js';
const getApps = async (_parent, params) => {
const apps = await App.findAll(params.name);
if (params.onlyWithTriggers) {
return apps.filter((app) => app.triggers?.length);
}
if (params.onlyWithActions) {
return apps.filter((app) => app.actions?.length);
}
return apps;
};
export default getApps;