Skip to main content

fetch_or_default

Function fetch_or_default 

Source
pub async fn fetch_or_default(user_id: i64) -> Result<AdminUserPref, Error>
Expand description

Fetch the prefs row for user_id, or return a struct filled with defaults (the row is not inserted; the caller decides whether to persist). id == 0 distinguishes the unsaved-default case.