mirror of
https://github.com/modrinth/code.git
synced 2026-08-28 10:34:53 +00:00
feat: preferences syncing frontend (#7192)
* feat: prefs frontend * fix: DI issue * fix: lint * feat: appearance settings cleanup + fix settings, remove pinia * fix: sync btn when logged out * fix: prepr * fix: sidebar issue * feat: language coverage + cleanup * feat: cleanup lang settings * fix: fmt * fix: CI * fix: ci * fix: storybook * feat: bring back loader/game version sort --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
This commit is contained in:
@@ -303,7 +303,11 @@ fn main() {
|
||||
"get_user_projects",
|
||||
"get_user_organizations",
|
||||
"get_user_collections",
|
||||
"get_user_preferences",
|
||||
"patch_user_preferences",
|
||||
"patch_user",
|
||||
"change_user_avatar",
|
||||
"delete_user_avatar",
|
||||
"block_user",
|
||||
"unblock_user",
|
||||
"get_blocked_users",
|
||||
|
||||
@@ -27,6 +27,19 @@ pub async fn get_user_collections(user_id: &str) -> Result<Value> {
|
||||
Ok(theseus::users::get_user_collections(user_id).await?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn get_user_preferences(user_id: &str) -> Result<Value> {
|
||||
Ok(theseus::users::get_user_preferences(user_id).await?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn patch_user_preferences(
|
||||
user_id: &str,
|
||||
preferences: Value,
|
||||
) -> Result<Value> {
|
||||
Ok(theseus::users::patch_user_preferences(user_id, preferences).await?)
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn patch_user(user_id: &str, patch: Value) -> Result<()> {
|
||||
Ok(theseus::users::patch_user(user_id, patch).await?)
|
||||
@@ -72,6 +85,8 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
|
||||
get_user_projects,
|
||||
get_user_organizations,
|
||||
get_user_collections,
|
||||
get_user_preferences,
|
||||
patch_user_preferences,
|
||||
patch_user,
|
||||
change_user_avatar,
|
||||
delete_user_avatar,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm turbo run dev --filter=@modrinth/app-frontend",
|
||||
"beforeDevCommand": "pnpm -w i18n:coverage && pnpm turbo run dev --filter=@modrinth/app-frontend",
|
||||
"beforeBuildCommand": "pnpm turbo run build --filter=@modrinth/app-frontend",
|
||||
"frontendDist": "../app-frontend/dist",
|
||||
"devUrl": "http://localhost:1420"
|
||||
|
||||
Reference in New Issue
Block a user