add: layouts api

This commit is contained in:
trisua 2025-07-02 20:14:04 -04:00
parent c83d0a9fc0
commit b493b2ade8
10 changed files with 353 additions and 22 deletions

View file

@ -1,7 +1,5 @@
use std::collections::HashMap;
use crate::model::layouts::CustomizablePage;
use super::{
oauth::AuthGrant,
permissions::{FinePermission, SecondaryPermission},
@ -63,11 +61,6 @@ pub struct User {
/// Users collect achievements through little actions across the site.
#[serde(default)]
pub achievements: Vec<Achievement>,
/// The ID of each layout the user is using.
///
/// Only applies if the user is a supporter.
#[serde(default)]
pub layouts: HashMap<CustomizablePage, usize>,
}
pub type UserConnections =
@ -326,7 +319,6 @@ impl User {
invite_code: 0,
secondary_permissions: SecondaryPermission::DEFAULT,
achievements: Vec::new(),
layouts: HashMap::new(),
}
}