fix: ui fixes
This commit is contained in:
+14
-6
@@ -505,18 +505,26 @@ export const notifications = {
|
||||
markAllRead() {
|
||||
return call<void>("/notifications/read", { method: "POST" });
|
||||
},
|
||||
/** Email-notification preferences (currently aggregated like emails). */
|
||||
emailPrefs() {
|
||||
return call<{ like_emails: boolean }>("/notifications/email-prefs");
|
||||
/** The event × channel notification matrix (Settings → Notifications). */
|
||||
prefs() {
|
||||
return call<{ prefs: NotificationPrefs }>("/notifications/prefs");
|
||||
},
|
||||
setEmailPrefs(likeEmails: boolean) {
|
||||
return call<{ like_emails: boolean }>("/notifications/email-prefs", {
|
||||
/** Write one matrix cell; returns the full re-resolved matrix. */
|
||||
setPref(event: PrefEvent, channel: PrefChannel, enabled: boolean) {
|
||||
return call<{ prefs: NotificationPrefs }>("/notifications/prefs", {
|
||||
method: "PUT",
|
||||
body: JSON.stringify({ like_emails: likeEmails }),
|
||||
body: JSON.stringify({ event, channel, enabled }),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// ─── Notification preferences ──────────────────────────────────────────
|
||||
|
||||
export type PrefEvent = "follows" | "post_interactions" | "sadhna_reminders";
|
||||
export type PrefChannel = "in_app" | "email" | "push";
|
||||
/** event → channel → enabled, as resolved by the BFF (defaults on). */
|
||||
export type NotificationPrefs = Record<PrefEvent, Record<PrefChannel, boolean>>;
|
||||
|
||||
export const relationships = {
|
||||
/** Send a follow REQUEST. The target must accept before it counts as a
|
||||
* follow — the returned relationship reflects `follow_requested: true`
|
||||
|
||||
Reference in New Issue
Block a user