Checks the rows settings-service.ts reads from user_settings, and turns
them into the UserSettings the settings endpoints answer.
f
isUserSettingsRow(obj: unknown): obj is UserSettingsRow
Checks whether obj, a row getSettings selected, is a
UserSettingsRow.
f
settingsRowToApi(row: UserSettingsRow): UserSettings
Converts a row to the UserSettings the client gets. A style or scheme the code no longer knows, as after one is removed, reads as unset.
I
UserSettingsRow
Stored by updateSettings and read back by getSettings. A user without a
row has the defaults.
- color_scheme: string | null
-
digest_monthly: number
0 or 1.
-
digest_weekly: number
0 or 1.
-
style: string | null
A style name, or null for the instance's.
- updated_at: string
- user_id: string
v
SETTINGS_COLUMNS: Record<keyof UserSettings, string>
Names the column of each setting, for the queries that pick users by one,
as digest-service.ts does by its digest's switch.
Usage
import * as mod from "api/model/settings.ts";