Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
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] };
}