mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
fix init edit on variable editor
This commit is contained in:
@@ -364,11 +364,6 @@ async fn update_resource(
|
||||
|
||||
let mut tx = user_db.begin(&authed).await?;
|
||||
|
||||
let sql = sqlb.sql().map_err(|e| Error::InternalErr(e.to_string()))?;
|
||||
let npath_o: Option<String> = sqlx::query_scalar(&sql).fetch_optional(&mut tx).await?;
|
||||
|
||||
let npath = not_found_if_none(npath_o, "Resource", path)?;
|
||||
|
||||
if let Some(npath) = ns.path {
|
||||
if npath != path {
|
||||
check_path_conflict(&mut tx, &w_id, &npath).await?;
|
||||
@@ -387,6 +382,11 @@ async fn update_resource(
|
||||
}
|
||||
}
|
||||
|
||||
let sql = sqlb.sql().map_err(|e| Error::InternalErr(e.to_string()))?;
|
||||
let npath_o: Option<String> = sqlx::query_scalar(&sql).fetch_optional(&mut tx).await?;
|
||||
|
||||
let npath = not_found_if_none(npath_o, "Resource", path)?;
|
||||
|
||||
audit_log(
|
||||
&mut tx,
|
||||
&authed.username,
|
||||
|
||||
@@ -370,10 +370,6 @@ async fn update_variable(
|
||||
}
|
||||
sqlb.returning("path");
|
||||
|
||||
let sql = sqlb.sql().map_err(|e| Error::InternalErr(e.to_string()))?;
|
||||
|
||||
let npath_o: Option<String> = sqlx::query_scalar(&sql).fetch_optional(&mut tx).await?;
|
||||
|
||||
if let Some(npath) = ns.path {
|
||||
if npath != path {
|
||||
check_path_conflict(&mut tx, &w_id, &npath).await?;
|
||||
@@ -391,6 +387,10 @@ async fn update_variable(
|
||||
}
|
||||
}
|
||||
|
||||
let sql = sqlb.sql().map_err(|e| Error::InternalErr(e.to_string()))?;
|
||||
|
||||
let npath_o: Option<String> = sqlx::query_scalar(&sql).fetch_optional(&mut tx).await?;
|
||||
|
||||
let npath = not_found_if_none(npath_o, "Variable", path)?;
|
||||
|
||||
audit_log(
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
drawer.openDrawer()
|
||||
}
|
||||
|
||||
export async function editVariable(path: string): Promise<void> {
|
||||
export async function editVariable(edit_path: string): Promise<void> {
|
||||
edit = true
|
||||
const getV = await VariableService.getVariable({
|
||||
workspace: $workspaceStore ?? '',
|
||||
path,
|
||||
path: edit_path,
|
||||
decryptSecret: false
|
||||
})
|
||||
can_write =
|
||||
@@ -64,7 +64,8 @@
|
||||
is_secret: getV.is_secret,
|
||||
description: getV.description ?? ''
|
||||
}
|
||||
initialPath = path
|
||||
initialPath = edit_path
|
||||
path = edit_path
|
||||
drawer.openDrawer()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user