This commit is contained in:
Ruben Fiszel
2023-07-27 09:50:16 +02:00
parent 4f3b4836c2
commit 7455b6301f
5 changed files with 13 additions and 7 deletions
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT content FROM script WHERE workspace_id = $1 AND path = $2\n ",
"query": "\n SELECT content FROM script WHERE path = $1 AND workspace_id = $2\n AND created_at = (SELECT max(created_at) FROM script WHERE path = $1 AND \n workspace_id = $2)\n ",
"describe": {
"columns": [
{
@@ -19,5 +19,5 @@
false
]
},
"hash": "9a5b63783851d77ebb960967d14029e82772afa577f0626c8c98ef7e1ce04b0c"
"hash": "d581bfb507d3a875f07677187717a469ec6ab1db1585835c961409612d81ec7d"
}
@@ -146,10 +146,12 @@ pub async fn parse_python_imports(
let nested = if n.starts_with("relative:") {
let code = sqlx::query_scalar!(
r#"
SELECT content FROM script WHERE workspace_id = $1 AND path = $2
SELECT content FROM script WHERE path = $1 AND workspace_id = $2
AND created_at = (SELECT max(created_at) FROM script WHERE path = $1 AND
workspace_id = $2)
"#,
w_id,
n.replace("relative:", "")
n.replace("relative:", ""),
w_id
)
.fetch_optional(db)
.await?
+2 -2
View File
@@ -37,7 +37,7 @@
export let error = ''
export let disabled = false
export let checkInitialPathExistence = false
export let autofocus = true
export let kind: PathKind
let inputP: HTMLInputElement | undefined = undefined
@@ -393,7 +393,7 @@
{disabled}
type="text"
id="path"
autofocus
{autofocus}
bind:this={inputP}
autocomplete="off"
on:keyup={handleKeyUp}
@@ -281,6 +281,7 @@
<input
type="text"
autofocus
bind:value={script.summary}
placeholder="Short summary to be displayed when listed"
/>
@@ -290,6 +291,7 @@
bind:error={pathError}
bind:path={script.path}
{initialPath}
autofocus={false}
namePlaceholder="script"
kind="script"
/>
@@ -71,6 +71,7 @@
>
<input
type="text"
autofocus
bind:value={$flowStore.summary}
placeholder="Short summary to be displayed when listed"
id="flow-summary"
@@ -79,6 +80,7 @@
<span class="text-secondary text-sm font-bold"> Path </span>
<Path
autofocus={false}
bind:this={path}
bind:path={$flowStore.path}
{initialPath}