From 86f33374f017cbd6ea788ae5408075b52e60b689 Mon Sep 17 00:00:00 2001 From: "Elias W. BA" Date: Wed, 10 Jul 2024 07:34:11 +0000 Subject: [PATCH] Do Not Require Lock Version In URL Parameters (#2268) * Do not pattern match on a query param * Update CHANGELOG.md --------- Co-authored-by: Taylor Downs --- CHANGELOG.md | 2 ++ lib/lightning_web/live/workflow_live/edit.ex | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc74e4debb..9217fbc8c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ and this project adheres to ### Fixed +- Do Not Require Lock Version In URL Parameters + [#2267](https://github.com/OpenFn/lightning/pull/2267) - Trim erroneous spaces on user first and last names [#2269](https://github.com/OpenFn/lightning/pull/2269) diff --git a/lib/lightning_web/live/workflow_live/edit.ex b/lib/lightning_web/live/workflow_live/edit.ex index c34171c86c..c45fd47931 100644 --- a/lib/lightning_web/live/workflow_live/edit.ex +++ b/lib/lightning_web/live/workflow_live/edit.ex @@ -920,11 +920,7 @@ defmodule LightningWeb.WorkflowLive.Edit do |> assign(page_title: "New Workflow") end - def apply_action( - socket, - :edit, - %{"id" => workflow_id, "v" => version} = params - ) do + def apply_action(socket, :edit, %{"id" => workflow_id} = params) do case socket.assigns.workflow do %{id: ^workflow_id} -> socket @@ -943,6 +939,8 @@ defmodule LightningWeb.WorkflowLive.Edit do if workflow do run_id = Map.get(params, "a") + version = Map.get(params, "v") || workflow.lock_version + snapshot = snapshot_by_version(workflow.id, version) socket