Skip to content

Commit

Permalink
Revert "feat: populate database for has_send_comp and add to api mu…
Browse files Browse the repository at this point in the history
…tation" (#4170)
  • Loading branch information
DafyddLlyr authored Jan 20, 2025
1 parent 4b57fd6 commit 0b5c783
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
11 changes: 1 addition & 10 deletions api.planx.uk/modules/flows/publish/service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import * as jsondiffpatch from "jsondiffpatch";
import { dataMerged, getMostRecentPublishedFlow } from "../../../helpers.js";
import { gql } from "graphql-request";
import {
ComponentType,
type FlowGraph,
type Node,
} from "@opensystemslab/planx-core/types";
import type { FlowGraph, Node } from "@opensystemslab/planx-core/types";
import { userContext } from "../../auth/middleware.js";
import { getClient } from "../../../client/index.js";
import { hasComponentType } from "../validate/helpers.js";

interface PublishFlow {
publishedFlow: {
Expand All @@ -26,7 +21,6 @@ export const publishFlow = async (flowId: string, summary?: string) => {

const flattenedFlow = await dataMerged(flowId);
const mostRecent = await getMostRecentPublishedFlow(flowId);
const hasSendComponent = hasComponentType(flattenedFlow, ComponentType.Send);
const delta = jsondiffpatch.diff(mostRecent, flattenedFlow);

if (!delta) return null;
Expand All @@ -39,15 +33,13 @@ export const publishFlow = async (flowId: string, summary?: string) => {
$flow_id: uuid
$publisher_id: Int
$summary: String
$has_send_component: Boolean
) {
publishedFlow: insert_published_flows_one(
object: {
data: $data
flow_id: $flow_id
publisher_id: $publisher_id
summary: $summary
has_send_component: $has_send_component
}
) {
id
Expand All @@ -63,7 +55,6 @@ export const publishFlow = async (flowId: string, summary?: string) => {
flow_id: flowId,
publisher_id: parseInt(userId),
summary: summary ?? null,
has_send_component: hasSendComponent,
},
);

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 0b5c783

Please sign in to comment.