fix(tauri, gui): Allow Tauri command to be called with empty arguments

- Allow Tauri command to be called with empty arguments
- Add struct for GetSwapInfosAllArgs
This commit is contained in:
binarybaron 2024-08-27 18:53:58 +02:00 committed by binarybaron
parent de1f77bf80
commit ca25e0454f
5 changed files with 185 additions and 1239 deletions

File diff suppressed because it is too large Load diff

View file

@ -344,6 +344,16 @@ impl Request for GetConfigArgs {
}
}
pub struct GetSwapInfosAllArgs;
impl Request for GetSwapInfosAllArgs {
type Response = Vec<GetSwapInfoResponse>;
async fn request(self, ctx: Arc<Context>) -> Result<Self::Response> {
get_swap_infos_all(ctx).await
}
}
#[tracing::instrument(fields(method = "suspend_current_swap"), skip(context))]
pub async fn suspend_current_swap(context: Arc<Context>) -> Result<SuspendCurrentSwapResponse> {
let swap_id = context.swap_lock.get_current_swap_id().await;