feat: Add find action substeps method to App model

This commit is contained in:
Faruk AYDIN
2024-03-02 16:20:53 +01:00
parent 7cdcf7ebab
commit e28c757352

View File

@@ -71,6 +71,15 @@ class App {
return appData?.actions || []; return appData?.actions || [];
} }
static async findActionSubsteps(appKey, actionKey, stripFuncs = false) {
const rawAppData = await getApp(appKey, stripFuncs);
const appData = appInfoConverter(rawAppData);
const action = appData?.actions?.find((action) => action.key === actionKey);
return action?.substeps || [];
}
static async checkAppAndAction(appKey, actionKey) { static async checkAppAndAction(appKey, actionKey) {
const app = await this.findOneByKey(appKey); const app = await this.findOneByKey(appKey);