Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233import { authedGet, authedPost, type AppviewContext } from "./appview";import type { XrpcRequestInit } from "./client";
// mirrors org.tangled.temp.notification.getPreferences#preferencesexport interface NotificationPreferences { repoStarred: boolean; issueCreated: boolean; issueCommented: boolean; issueClosed: boolean; pullCreated: boolean; pullCommented: boolean; pullMerged: boolean; followed: boolean; userMentioned: boolean; emailNotifications: boolean;}
const GET_PREFERENCES = "org.tangled.temp.notification.getPreferences";const UPDATE_PREFERENCES = "org.tangled.temp.notification.updatePreferences";
export const getNotificationPreferences = ( ctx: AppviewContext, init?: XrpcRequestInit): Promise<NotificationPreferences> => authedGet<NotificationPreferences>(ctx, GET_PREFERENCES, undefined, init);
// only the provided fields are updated server-side.export const updateNotificationPreferences = ( ctx: AppviewContext, patch: Partial<NotificationPreferences>, init?: XrpcRequestInit): Promise<void> => authedPost(ctx, UPDATE_PREFERENCES, patch, init).then(() => undefined);