Add notification settings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import client from './client'
|
||||
import type { User, UserProfilePublic, UserStats, PasswordChangeData } from '@/types'
|
||||
import type { User, UserProfilePublic, UserStats, PasswordChangeData, NotificationSettings, NotificationSettingsUpdate } from '@/types'
|
||||
|
||||
export interface UpdateNicknameData {
|
||||
nickname: string
|
||||
@@ -48,4 +48,16 @@ export const usersApi = {
|
||||
})
|
||||
return URL.createObjectURL(response.data)
|
||||
},
|
||||
|
||||
// Получить настройки уведомлений
|
||||
getNotificationSettings: async (): Promise<NotificationSettings> => {
|
||||
const response = await client.get<NotificationSettings>('/users/me/notifications')
|
||||
return response.data
|
||||
},
|
||||
|
||||
// Обновить настройки уведомлений
|
||||
updateNotificationSettings: async (data: NotificationSettingsUpdate): Promise<NotificationSettings> => {
|
||||
const response = await client.patch<NotificationSettings>('/users/me/notifications', data)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user