Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

512 B
Raw Blame
import type { GetNotificationTypePreferencesResponse } from '@service-notification/generated/schemas/getNotificationTypePreferencesResponse';

export function applyPreferenceToggle(
  current: GetNotificationTypePreferencesResponse | undefined,
  type: string,
  enabled: boolean
): GetNotificationTypePreferencesResponse {
  const disabled = new Set(current?.disabled_types ?? []);
  if (enabled) {
    disabled.delete(type);
  } else {
    disabled.add(type);
  }
  return { disabled_types: [...disabled] };
}