Skip to content

Commit

Permalink
getFlowData should still return team_id
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Feb 19, 2024
1 parent 80cebdc commit 7811c03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api.planx.uk/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { Flow, Node } from "./types";
import { ComponentType, FlowGraph } from "@opensystemslab/planx-core/types";
import { $public, getClient } from "./client";

interface FlowData {
export interface FlowData {
slug: string;
data: Flow["data"];
team_id: number;
team: { "slug": string; };
publishedFlows: { "data": Flow["data"]; }[] | [];
}
Expand All @@ -19,6 +20,7 @@ const getFlowData = async (id: string): Promise<FlowData> => {
flow: flows_by_pk(id: $id) {
slug
data
team_id
team {
slug
}
Expand Down
3 changes: 1 addition & 2 deletions api.planx.uk/modules/flows/copyFlow/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { makeUniqueFlow, getFlowData, insertFlow } from "../../../helpers";
import { Flow } from "../../../types";
import { userContext } from "../../auth/middleware";

const copyFlow = async (
Expand All @@ -8,7 +7,7 @@ const copyFlow = async (
insert: boolean,
) => {
// Fetch the original flow
const flow: Flow = await getFlowData(flowId);
const flow = await getFlowData(flowId);

// Generate new flow data which is an exact "content" copy of the original but with unique nodeIds
const uniqueFlowData = makeUniqueFlow(flow.data, replaceValue);
Expand Down

0 comments on commit 7811c03

Please sign in to comment.