18 lines
357 B
JavaScript
18 lines
357 B
JavaScript
import App from '../../models/app';
|
|
|
|
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;
|