mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-02 20:53:13 +08:00
21 lines
693 B
TypeScript
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
|
|
}
|
|
}
|