feat: show not found UI in app/connection flows

This commit is contained in:
Ali BARIN
2022-08-11 20:26:35 +02:00
parent c6c3cbb1d3
commit c827ce4270
6 changed files with 62 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ import Context from '../../types/express/context';
type Params = {
input: {
triggerAppKey: string;
connectionId: string;
};
};
@@ -12,23 +13,32 @@ const createFlow = async (
params: Params,
context: Context
) => {
const connectionId = params?.input?.connectionId;
const appKey = params?.input?.triggerAppKey;
const flow = await context.currentUser.$relatedQuery('flows').insert({
name: 'Name your flow',
});
if (connectionId) {
await context.currentUser
.$relatedQuery('connections')
.findById(connectionId)
.throwIfNotFound();
}
await Step.query().insert({
flowId: flow.id,
type: 'trigger',
position: 1,
appKey,
connectionId
});
await Step.query().insert({
flowId: flow.id,
type: 'action',
position: 2,
position: 2
});
return flow;

View File

@@ -251,6 +251,7 @@ input DeleteConnectionInput {
input CreateFlowInput {
triggerAppKey: String
connectionId: String
}
input UpdateFlowInput {