diff options
author | crupest <crupest@outlook.com> | 2022-04-27 20:57:41 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-04-27 20:57:41 +0800 |
commit | a4f5080c6dc8c3fc7f76aebb13cbf54c0ed7ef15 (patch) | |
tree | 067f053e57260dd3f876590dcbc7802721eaac50 /FrontEnd/src/http/user.ts | |
parent | 6c10782e909427a8e6ddd56d1d081d19346b9688 (diff) | |
download | timeline-a4f5080c6dc8c3fc7f76aebb13cbf54c0ed7ef15.tar.gz timeline-a4f5080c6dc8c3fc7f76aebb13cbf54c0ed7ef15.tar.bz2 timeline-a4f5080c6dc8c3fc7f76aebb13cbf54c0ed7ef15.zip |
...
Diffstat (limited to 'FrontEnd/src/http/user.ts')
-rw-r--r-- | FrontEnd/src/http/user.ts | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/FrontEnd/src/http/user.ts b/FrontEnd/src/http/user.ts index 17c4adbb..c62f852c 100644 --- a/FrontEnd/src/http/user.ts +++ b/FrontEnd/src/http/user.ts @@ -1,5 +1,3 @@ -import { AxiosError } from "axios"; - import { axios, apiBaseUrl, extractResponseData, extractEtag } from "./common"; export const kUserManagement = "UserManagement"; @@ -41,12 +39,6 @@ export interface HttpBookmarkVisibility { visibility: "Private" | "Register" | "Public"; } -export class HttpChangePasswordBadCredentialError extends Error { - constructor(public innerError?: AxiosError) { - super(); - } -} - export interface IHttpUserClient { list(): Promise<HttpUser[]>; get(username: string): Promise<HttpUser>; @@ -135,16 +127,7 @@ export class HttpUserClient implements IHttpUserClient { } changePassword(req: HttpChangePasswordRequest): Promise<void> { - return axios - .post(`${apiBaseUrl}/v2/self/changepassword`, req) - .then(undefined, (error: AxiosError) => { - const statusCode = error.response?.status; - if (statusCode === 422) { - throw new HttpChangePasswordBadCredentialError(error); - } else { - throw error; - } - }); + return axios.post(`${apiBaseUrl}/v2/self/changepassword`, req).then(); } getBookmarkVisibility(username: string): Promise<HttpBookmarkVisibility> { |