1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-28 14:16:41 +07:00

getting messages diff

This commit is contained in:
Fedor Katurov 2020-09-09 18:45:29 +07:00
parent e1117a0d91
commit d935e9de42
8 changed files with 87 additions and 17 deletions

View file

@ -5,9 +5,16 @@ import { API } from '~/constants/api';
export const apiMessagesGetUserMessages = ({
access,
username,
after,
before,
}: {
access: string;
username: string;
after?: string;
before?: string;
}): Promise<IResultWithStatus<{ messages: IMessage[] }>> =>
api
.get(API.USER.MESSAGES(username), configWithToken(access))
.get(API.USER.MESSAGES(username), configWithToken(access, { params: { after, before } }))
.then(resultMiddleware)
.catch(errorMiddleware);