mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-11-21 16:01:46 +01:00
Create new workspace, and more optimizations
This commit is contained in:
1 parent
5981588c95
commit
d9b38efd97
20 files changed
+272
-133
No files matched your search
@@ -226,6 +226,23 @@ async fn set_key_value(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn create_workspace(
|
||||
name: &str,
|
||||
app_handle: AppHandle<Wry>,
|
||||
db_instance: State<'_, Mutex<Pool<Sqlite>>>,
|
||||
) -> Result<String, String> {
|
||||
let pool = &*db_instance.lock().await;
|
||||
let created_workspace =
|
||||
models::create_workspace(name, "", pool).await.expect("Failed to create workspace");
|
||||
|
||||
app_handle
|
||||
.emit_all("updated_workspace", &created_workspace)
|
||||
.unwrap();
|
||||
|
||||
Ok(created_workspace.id)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn create_request(
|
||||
workspace_id: &str,
|
||||
@@ -478,6 +495,7 @@ fn main() {
|
||||
requests,
|
||||
send_request,
|
||||
create_request,
|
||||
create_workspace,
|
||||
update_request,
|
||||
delete_request,
|
||||
responses,
|
||||
|
||||
Reference in new issue
Block a user