Environment dropdown and actions

This commit is contained in:
Gregory Schier
2023-10-24 09:17:29 -07:00
parent e74f9f33c0
commit cb5d7626ac
11 changed files with 201 additions and 35 deletions

View File

@@ -254,6 +254,7 @@ pub async fn create_environment(
pub async fn update_environment(
id: &str,
name: &str,
data: HashMap<String, JsonValue>,
pool: &Pool<Sqlite>,
) -> Result<Environment, sqlx::Error> {
@@ -262,9 +263,10 @@ pub async fn update_environment(
sqlx::query!(
r#"
UPDATE environments
SET (data, updated_at) = (?, CURRENT_TIMESTAMP)
SET (name, data, updated_at) = (?, ?, CURRENT_TIMESTAMP)
WHERE id = ?;
"#,
name,
json_data,
id,
)