Skip to content

Commit

Permalink
revert changes to store
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory Doak authored and Rory Doak committed May 28, 2024
1 parent c717645 commit e82bcd6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions editor.planx.uk/src/pages/FlowEditor/lib/store/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface EditorStore extends Store.Store {
connectTo: (id: Store.nodeId) => void;
copyFlow: (flowId: string) => Promise<any>;
copyNode: (id: Store.nodeId) => void;
createFlow: (teamId: any, newSlug: any, newName: string) => Promise<string>;
createFlow: (teamId: any, newSlug: any) => Promise<string>;
deleteFlow: (teamId: number, flowSlug: string) => Promise<object>;
validateAndDiffFlow: (flowId: string) => Promise<any>;
getFlows: (teamId: number) => Promise<any>;
Expand Down Expand Up @@ -186,17 +186,12 @@ export const editorStore: StateCreator<
localStorage.setItem("clipboard", id);
},

createFlow: async (teamId, newSlug, newName) => {
createFlow: async (teamId, newSlug) => {
let response = (await client.mutate({
mutation: gql`
mutation CreateFlow(
$data: jsonb
$slug: String
$name: String
$teamId: Int
) {
mutation CreateFlow($data: jsonb, $slug: String, $teamId: Int) {
insert_flows_one(
object: { slug: $slug, name: $name, team_id: $teamId, version: 1 }
object: { slug: $slug, team_id: $teamId, version: 1 }
) {
id
data
Expand All @@ -206,7 +201,6 @@ export const editorStore: StateCreator<
variables: {
slug: newSlug,
teamId,
name: newName,
},
})) as any;

Expand Down Expand Up @@ -283,7 +277,7 @@ export const editorStore: StateCreator<
where: { team: { id: { _eq: $teamId } } }
) {
id
name
slug
updated_at
operations(limit: 1, order_by: { id: desc }) {
Expand Down

0 comments on commit e82bcd6

Please sign in to comment.