Files
xingrin/frontend/services/notification-settings.service.ts
2025-12-12 18:04:57 +08:00

21 lines
693 B
TypeScript

import { api } from '@/lib/api-client'
import type {
GetNotificationSettingsResponse,
UpdateNotificationSettingsRequest,
UpdateNotificationSettingsResponse,
} from '@/types/notification-settings.types'
export class NotificationSettingsService {
static async getSettings(): Promise<GetNotificationSettingsResponse> {
const res = await api.get<GetNotificationSettingsResponse>('/settings/notifications/')
return res.data
}
static async updateSettings(
data: UpdateNotificationSettingsRequest
): Promise<UpdateNotificationSettingsResponse> {
const res = await api.put<UpdateNotificationSettingsResponse>('/settings/notifications/', data)
return res.data
}
}