mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
added apiAuthDeleteMessage
This commit is contained in:
parent
5e85ae2aee
commit
9bdeb5aa0a
2 changed files with 15 additions and 2 deletions
|
@ -11,6 +11,7 @@ export const API = {
|
|||
PROFILE: (username: string) => `/user/user/${username}/profile`,
|
||||
MESSAGES: (username: string) => `/user/user/${username}/messages`,
|
||||
MESSAGE_SEND: (username: string) => `/user/user/${username}/messages`,
|
||||
MESSAGE_DELETE: (username: string, id: number) => `/user/user/${username}/messages/${id}`,
|
||||
GET_UPDATES: '/user/updates',
|
||||
REQUEST_CODE: (code?: string) => `/user/restore/${code || ''}`,
|
||||
UPLOAD: (target, type) => `/upload/${target}/${type}`,
|
||||
|
@ -19,8 +20,6 @@ export const API = {
|
|||
DROP_SOCIAL: (provider, id) => `/oauth/${provider}/${id}`,
|
||||
ATTACH_SOCIAL: `/oauth/attach`,
|
||||
LOGIN_WITH_SOCIAL: `/oauth/login`,
|
||||
// TODO: REMOVE
|
||||
VKONTAKTE_LOGIN: `${process.env.API_HOST}/oauth/vkontakte/redirect/login`,
|
||||
},
|
||||
NODE: {
|
||||
SAVE: '/node/',
|
||||
|
|
|
@ -51,6 +51,20 @@ export const apiAuthSendMessage = ({
|
|||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
||||
export const apiAuthDeleteMessage = ({
|
||||
access,
|
||||
username,
|
||||
id,
|
||||
}: {
|
||||
access: string;
|
||||
username: string;
|
||||
id: number;
|
||||
}): Promise<IResultWithStatus<{ message: IMessage }>> =>
|
||||
api
|
||||
.delete(API.USER.MESSAGE_DELETE(username, id), configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
||||
export const apiAuthGetUpdates = ({
|
||||
access,
|
||||
exclude_dialogs,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue