mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
notifications: updating lastSeen when list is opened
This commit is contained in:
parent
a39d000ff2
commit
97590d88af
7 changed files with 88 additions and 4 deletions
|
@ -4,6 +4,8 @@ import { api, cleanResult } from '~/utils/api';
|
|||
import {
|
||||
ApiGetNotificationSettingsResponse,
|
||||
ApiGetNotificationsResponse,
|
||||
ApiUpdateNotificationSettingsResponse,
|
||||
ApiUpdateNotificationSettingsRequest,
|
||||
} from './types';
|
||||
|
||||
export const apiGetNotificationSettings = () =>
|
||||
|
@ -15,3 +17,13 @@ export const apiGetNotifications = () =>
|
|||
api
|
||||
.get<ApiGetNotificationsResponse>(API.NOTIFICATIONS.LIST)
|
||||
.then(cleanResult);
|
||||
|
||||
export const apiUpdateNotificationSettings = (
|
||||
settings: ApiUpdateNotificationSettingsRequest,
|
||||
) =>
|
||||
api
|
||||
.post<ApiUpdateNotificationSettingsResponse>(
|
||||
API.NOTIFICATIONS.SETTINGS,
|
||||
settings,
|
||||
)
|
||||
.then(cleanResult);
|
||||
|
|
|
@ -7,7 +7,11 @@ export interface ApiGetNotificationSettingsResponse {
|
|||
last_seen?: string | null;
|
||||
last_date?: string | null;
|
||||
}
|
||||
export type ApiUpdateNotificationSettingsResponse =
|
||||
ApiGetNotificationSettingsResponse;
|
||||
|
||||
export type ApiUpdateNotificationSettingsRequest =
|
||||
Partial<ApiGetNotificationSettingsResponse>;
|
||||
export interface ApiGetNotificationsResponse {
|
||||
items?: NotificationItem[];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue