Reads and writes each user's settings in user_settings. routes/me.ts
answers GET and PATCH /api/me/settings with it, and the digests read
their readers' choices from the same table.
f
getSettings(userId: string): UserSettings
Returns the settings of user userId, the defaults if they changed none.
f
updateSettings(): UserSettings
userId: string,
patch: UpdateSettingsRequest
Applies patch to the settings of user userId and returns them all. The
settings it leaves out keep their value.
Usage
import * as mod from "api/services/settings-service.ts";