mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed api call for code request
This commit is contained in:
parent
27665c462a
commit
b91ff98491
3 changed files with 5 additions and 18 deletions
|
@ -42,11 +42,10 @@ export const apiAuthGetUpdates = ({ exclude_dialogs, last }: ApiAuthGetUpdatesRe
|
||||||
export const apiUpdateUser = ({ user }: ApiUpdateUserRequest) =>
|
export const apiUpdateUser = ({ user }: ApiUpdateUserRequest) =>
|
||||||
api.patch<ApiUpdateUserResult>(API.USER.ME, user).then(cleanResult);
|
api.patch<ApiUpdateUserResult>(API.USER.ME, user).then(cleanResult);
|
||||||
|
|
||||||
export const apiRequestRestoreCode = ({ field }): Promise<IResultWithStatus<{}>> =>
|
export const apiRequestRestoreCode = ({ field }: { field: string }) =>
|
||||||
api
|
api
|
||||||
.post(API.USER.REQUEST_CODE(), { field })
|
.post<{}>(API.USER.REQUEST_CODE(), { field })
|
||||||
.then(resultMiddleware)
|
.then(cleanResult);
|
||||||
.catch(errorMiddleware);
|
|
||||||
|
|
||||||
export const apiCheckRestoreCode = ({ code }: ApiCheckRestoreCodeRequest) =>
|
export const apiCheckRestoreCode = ({ code }: ApiCheckRestoreCodeRequest) =>
|
||||||
api.get<ApiCheckRestoreCodeResult>(API.USER.REQUEST_CODE(code)).then(cleanResult);
|
api.get<ApiCheckRestoreCodeResult>(API.USER.REQUEST_CODE(code)).then(cleanResult);
|
||||||
|
|
|
@ -75,8 +75,8 @@ function* sendLoginRequestSaga({ username, password }: ReturnType<typeof userSen
|
||||||
yield put(authSetUser({ ...user, is_user: true }));
|
yield put(authSetUser({ ...user, is_user: true }));
|
||||||
yield put(authLoggedIn());
|
yield put(authLoggedIn());
|
||||||
yield put(modalSetShown(false));
|
yield put(modalSetShown(false));
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
yield put(userSetLoginError(e));
|
yield put(userSetLoginError(error.message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,18 +39,6 @@ export type ApiGetNodeCommentsResponse = { comments: IComment[]; comment_count:
|
||||||
export const apiPostNode = ({ node }: ApiPostNodeRequest) =>
|
export const apiPostNode = ({ node }: ApiPostNodeRequest) =>
|
||||||
api.post<ApiPostNodeResult>(API.NODE.SAVE, node).then(cleanResult);
|
api.post<ApiPostNodeResult>(API.NODE.SAVE, node).then(cleanResult);
|
||||||
|
|
||||||
export const getNodes = ({
|
|
||||||
from,
|
|
||||||
access,
|
|
||||||
}: {
|
|
||||||
from?: string;
|
|
||||||
access: string;
|
|
||||||
}): Promise<IResultWithStatus<{ nodes: INode[] }>> =>
|
|
||||||
api
|
|
||||||
.get(API.NODE.GET, configWithToken(access, { params: { from } }))
|
|
||||||
.then(resultMiddleware)
|
|
||||||
.catch(errorMiddleware);
|
|
||||||
|
|
||||||
export const getNodeDiff = ({
|
export const getNodeDiff = ({
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue