mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
add user notifications (#148)
* added notification settings * notifications: added list to profile * notifications: changed appearance for comment notifications
This commit is contained in:
parent
23701a5261
commit
a39d000ff2
27 changed files with 552 additions and 218 deletions
17
src/api/notifications/settings.ts
Normal file
17
src/api/notifications/settings.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { API } from '~/constants/api';
|
||||
import { api, cleanResult } from '~/utils/api';
|
||||
|
||||
import {
|
||||
ApiGetNotificationSettingsResponse,
|
||||
ApiGetNotificationsResponse,
|
||||
} from './types';
|
||||
|
||||
export const apiGetNotificationSettings = () =>
|
||||
api
|
||||
.get<ApiGetNotificationSettingsResponse>(API.NOTIFICATIONS.SETTINGS)
|
||||
.then(cleanResult);
|
||||
|
||||
export const apiGetNotifications = () =>
|
||||
api
|
||||
.get<ApiGetNotificationsResponse>(API.NOTIFICATIONS.LIST)
|
||||
.then(cleanResult);
|
13
src/api/notifications/types.ts
Normal file
13
src/api/notifications/types.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { NotificationItem } from '~/types/notifications';
|
||||
|
||||
export interface ApiGetNotificationSettingsResponse {
|
||||
enabled: boolean;
|
||||
flow: boolean;
|
||||
comments: boolean;
|
||||
last_seen?: string | null;
|
||||
last_date?: string | null;
|
||||
}
|
||||
|
||||
export interface ApiGetNotificationsResponse {
|
||||
items?: NotificationItem[];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue