mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-01 23:23:04 +02:00
Clean up DB refactor access (#192)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::error::Result;
|
||||
use crate::manager::QueryManagerExt;
|
||||
use crate::query_manager::QueryManagerExt;
|
||||
use crate::models::AnyModel;
|
||||
use crate::queries_legacy::UpdateSource;
|
||||
use crate::util::UpdateSource;
|
||||
use tauri::{Runtime, WebviewWindow};
|
||||
|
||||
#[tauri::command]
|
||||
@@ -9,9 +9,8 @@ pub(crate) async fn upsert<R: Runtime>(
|
||||
window: WebviewWindow<R>,
|
||||
model: AnyModel,
|
||||
) -> Result<String> {
|
||||
let queries = window.queries().connect().await?;
|
||||
let id = match model {
|
||||
AnyModel::HttpRequest(r) => queries.upsert(&r, &UpdateSource::from_window(&window))?.id,
|
||||
AnyModel::HttpRequest(r) => window.db().upsert(&r, &UpdateSource::from_window(&window))?.id,
|
||||
_ => todo!(),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user