diff --git a/src/pages/setting/Setting.tsx b/src/pages/setting/Setting.tsx index 87c6c0fb..a69302d0 100644 --- a/src/pages/setting/Setting.tsx +++ b/src/pages/setting/Setting.tsx @@ -2,10 +2,6 @@ import { type ChangeEvent, useEffect, useMemo, useState } from "react"; import { toast } from "sonner"; import type { IApiErrorResponse } from "@/types/common/common"; -import type { - IChannelNotificationSettings, - IWorkspaceNotificationSettings, -} from "@/types/setting/notification"; import { useImageUploader } from "@/hooks/common/useImageUploader"; import { useCoreQuery } from "@/hooks/customQuery"; @@ -22,6 +18,16 @@ import { getMyWorkspaces } from "@/api/workspace/org"; import { QUERY_KEYS } from "@/lib/queryKeys"; import useWorkspaceStore from "@/store/useWorkspaceStore"; +interface IChannelNotificationSettings { + browserPush: boolean; + emailNotif: boolean; +} + +interface IWorkspaceNotificationSettings { + clickAlarm: boolean; + weeklyReport: boolean; +} + const DEFAULT_CHANNEL: IChannelNotificationSettings = { browserPush: false, emailNotif: false, diff --git a/src/types/setting/notification.ts b/src/types/setting/notification.ts index 59ed5295..4a315624 100644 --- a/src/types/setting/notification.ts +++ b/src/types/setting/notification.ts @@ -1,9 +1,73 @@ -export interface IChannelNotificationSettings { - browserPush: boolean; - emailNotif: boolean; +import type { TMemberRole } from "@/types/workspace/workspace"; + +//공통 empty data +export type TNotificationEmptyData = Record; + +//GET .../members +export interface INotificationMemberItem { + membershipId: number; + name: string; + email: string; + role: TMemberRole; + isReceive: boolean; +} +export interface INotificationMembersData { + hasNext: boolean; + nextCursor: string | null; + members: INotificationMemberItem[]; +} +export interface INotificationMembersParams { + cursor?: string; +} + +//GET .../settings/{orgId} +export interface IMyNotificationSettings { + isMasterEnabled: boolean; + isBrowserPushEnabled: boolean; + isEmailEnabled: boolean; + isSlackEnabled: boolean; + isSlackConnected: boolean; + isDiscordEnabled: boolean; + isDiscordConnected: boolean; + alertClicks: boolean; + alertReport: boolean; + orgAlertClicks: boolean; + orgAlertReport: boolean; +} +//PATCH .../org +export interface IUpdateOrgNotificationSettingsRequest { + isSlackEnabled: boolean; + slackWebhookUrl: string; + disconnectSlack: boolean; + isDiscordEnabled: boolean; + discordWebhookUrl: string; + disconnectDiscord: boolean; + alertClicks: boolean; + alertReport: boolean; +} + +//PATCH .../members +export interface IUpdateNotificationMemberItem { + membershipId: number; + isReceive: boolean; +} +export interface IUpdateNotificationMembersRequest { + members: IUpdateNotificationMemberItem[]; +} + +//PATCH .../master +export interface IUpdateMasterNotificationSettingRequest { + isMasterEnabled: boolean; +} + +//PATCH .../channels +export interface IUpdateChannelNotificationSettingsRequest { + isBrowserPushEnabled: boolean; + isEmailEnabled: boolean; } -export interface IWorkspaceNotificationSettings { - clickAlarm: boolean; - weeklyReport: boolean; +//PATCH .../alerts +export interface IUpdateAlertsNotificationSettingsRequest { + alertClicks: boolean; + alertReport: boolean; }