Skip to content

Commit

Permalink
[BUG]: 400 error occurs when navigating from workflow to home (#4894)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvince2 authored Sep 24, 2024
1 parent 2bd128b commit db16c8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ import * as ModelComparisonOp from '@/components/workflow/ops/model-comparison/m
import * as RegriddingOp from '@/components/workflow/ops/regridding/mod';
import * as InterventionPolicyOp from '@/components/workflow/ops/intervention-policy/mod';
import { subscribe, unsubscribe } from '@/services/ClientEventService';
import { activeProjectId } from '@/composables/activeProject';
const WORKFLOW_SAVE_INTERVAL = 4000;
Expand Down Expand Up @@ -279,6 +280,7 @@ const contextMenu = ref();
const isRenamingWorkflow = ref(false);
const newWorkflowName = ref('');
const currentProjectId = ref<string | null>(null);
const optionsMenu = ref();
const optionsMenuItems = ref([
Expand Down Expand Up @@ -308,7 +310,7 @@ async function updateWorkflowName() {
// eslint-disable-next-line
const _saveWorkflow = async () => {
await workflowService.updateWorkflow(wf.value.dump());
await workflowService.updateWorkflow(wf.value.dump(), currentProjectId.value ?? undefined);
// wf.value.update(updated);
};
// eslint-disable-next-line
Expand Down Expand Up @@ -972,6 +974,7 @@ onMounted(() => {
}, WORKFLOW_SAVE_INTERVAL);
subscribe(ClientEventType.WorkflowUpdate, updateWorkflowHandler);
currentProjectId.value = activeProjectId.value;
});
onUnmounted(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/hmi-client/src/services/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ export const createWorkflow = async (workflow: Workflow) => {
};

// Update
export const updateWorkflow = async (workflow: Workflow) => {
export const updateWorkflow = async (workflow: Workflow, projectId?: string) => {
const id = workflow.id;
const response = await API.put(`/workflows/${id}`, workflow);
const response = await API.put(`/workflows/${id}`, workflow, { params: { 'project-id': projectId } });
return response?.data ?? null;
};

Expand Down

0 comments on commit db16c8f

Please sign in to comment.