feat: add default flow name
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
b822e25359
commit
3e5b9478c7
@@ -11,7 +11,9 @@ type Params = {
|
|||||||
const createFlowResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
const createFlowResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
||||||
const appKey = params?.input?.triggerAppKey;
|
const appKey = params?.input?.triggerAppKey;
|
||||||
|
|
||||||
const flow = await req.currentUser.$relatedQuery('flows').insert({});
|
const flow = await req.currentUser.$relatedQuery('flows').insert({
|
||||||
|
name: 'Name your flow',
|
||||||
|
});
|
||||||
|
|
||||||
await Step.query().insert({
|
await Step.query().insert({
|
||||||
flowId: flow.id,
|
flowId: flow.id,
|
||||||
|
@@ -3,6 +3,7 @@ import Step from './step';
|
|||||||
|
|
||||||
class Flow extends Base {
|
class Flow extends Base {
|
||||||
id!: number;
|
id!: number;
|
||||||
|
name: string;
|
||||||
userId!: number;
|
userId!: number;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
steps?: [Step];
|
steps?: [Step];
|
||||||
@@ -14,6 +15,7 @@ class Flow extends Base {
|
|||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
id: { type: 'integer' },
|
id: { type: 'integer' },
|
||||||
|
name: { type: 'string' },
|
||||||
userId: { type: 'integer' },
|
userId: { type: 'integer' },
|
||||||
active: { type: 'boolean' },
|
active: { type: 'boolean' },
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user