fix: only show apps with actions in action step

This commit is contained in:
Ali BARIN
2022-10-15 13:35:14 +02:00
parent b5e5ae7321
commit c0dfc101b2
6 changed files with 14 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import { IApp } from '@automatisch/types';
type Params = {
name: string;
onlyWithTriggers: boolean;
onlyWithActions: boolean;
};
const getApps = async (_parent: unknown, params: Params) => {
@@ -13,6 +14,10 @@ const getApps = async (_parent: unknown, params: Params) => {
return apps.filter((app: IApp) => app.triggers?.length);
}
if (params.onlyWithActions) {
return apps.filter((app: IApp) => app.actions?.length);
}
return apps;
};

View File

@@ -1,5 +1,5 @@
type Query {
getApps(name: String, onlyWithTriggers: Boolean): [App]
getApps(name: String, onlyWithTriggers: Boolean, onlyWithActions: Boolean): [App]
getApp(key: AvailableAppsEnumType!): App
getConnectedApps(name: String): [App]
testConnection(id: String!): Connection