Skip to content

Commit

Permalink
use new table for aliases, add alias deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
ellie committed Apr 10, 2024
1 parent 390ef0c commit 7d6785b
Show file tree
Hide file tree
Showing 11 changed files with 813 additions and 40 deletions.
12 changes: 12 additions & 0 deletions ui/backend/src/dotfiles/aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ pub async fn aliases() -> Result<Vec<Alias>, String> {
Ok(aliases)
}

#[tauri::command]
pub async fn delete_alias(name: String) -> Result<(), String> {
let alias_store = alias_store().await.map_err(|e| e.to_string())?;

alias_store
.delete(name.as_str())
.await
.map_err(|e| e.to_string())?;

Ok(())
}

#[tauri::command]
pub async fn import_aliases() -> Result<Vec<Alias>, String> {
let store = alias_store().await.map_err(|e| e.to_string())?;
Expand Down
1 change: 1 addition & 0 deletions ui/backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fn main() {
global_stats,
aliases,
dotfiles::aliases::import_aliases,
dotfiles::aliases::delete_alias,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
Expand Down
3 changes: 3 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"dependencies": {
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^2.1.3",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-slot": "^1.0.2",
"@tailwindcss/forms": "^0.5.7",
"@tanstack/react-table": "^8.15.3",
"@tauri-apps/api": "2.0.0-beta.7",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
Expand Down
273 changes: 273 additions & 0 deletions ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7d6785b

Please sign in to comment.