refactor: rewrite useApps with RQ

This commit is contained in:
Rıdvan Akca
2024-03-04 17:25:49 +03:00
parent 1870aead73
commit e5670d820d
5 changed files with 76 additions and 21 deletions

View File

@@ -4,11 +4,11 @@ import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
let apps = await App.findAll(request.query.name);
if (request.query.onlyWithTriggers) {
if (request.query.onlyWithTriggers === 'true') {
apps = apps.filter((app) => app.triggers?.length);
}
if (request.query.onlyWithActions) {
if (request.query.onlyWithActions === 'true') {
apps = apps.filter((app) => app.actions?.length);
}