Trouble with json serializing in tauri command #11375
Answered
by
FabianLars
pan-grayza
asked this question in
Q&A
-
In rust I have this command: #[tauri::command]
pub fn remove_network(app: AppHandle, network_name: String) -> Result<String, FileError> {
// Logic
Ok("Network removed successfully".to_string())
} And on frontend I got this function: async function remove_network(networkName: string) {
await invoke('remove_network', { networkName })
} And for some reason I am getting this error on frontend:
Which is weird because I have identical invoke for almost identical command that works fine: async function unlink_directory(pathName: string) {
await invoke('unlink_directory', { pathName })
} #[tauri::command]
pub fn unlink_directory(app: AppHandle, path_name: String) -> Result<String, FileError> {
// Logic
Ok("Directory unlinked successfully".to_string())
} Update:I tried a lot of stuff, but still Im getting error specifically on this command |
Beta Was this translation helpful? Give feedback.
Answered by
FabianLars
Oct 17, 2024
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pan-grayza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// logic
contains?