feat: validate app and action input in createStep

This commit is contained in:
Ali BARIN
2023-03-12 11:26:50 +00:00
parent ba27fc12e8
commit 7b3f070973

View File

@@ -1,3 +1,4 @@
import App from '../../models/app';
import Context from '../../types/express/context';
type Params = {
@@ -23,6 +24,14 @@ const createStep = async (
) => {
const { input } = params;
if (input.appKey && input.key) {
await App.checkAppAndAction(input.appKey, input.key);
}
if (input.appKey && !input.key) {
await App.findOneByKey(input.appKey);
}
const flow = await context.currentUser
.$relatedQuery('flows')
.findOne({