diff options
Diffstat (limited to 'FrontEnd/src/app/http')
-rw-r--r-- | FrontEnd/src/app/http/bookmark.ts | 34 | ||||
-rw-r--r-- | FrontEnd/src/app/http/common.ts | 69 | ||||
-rw-r--r-- | FrontEnd/src/app/http/highlight.ts | 34 | ||||
-rw-r--r-- | FrontEnd/src/app/http/search.ts | 22 | ||||
-rw-r--r-- | FrontEnd/src/app/http/timeline.ts | 324 | ||||
-rw-r--r-- | FrontEnd/src/app/http/token.ts | 7 | ||||
-rw-r--r-- | FrontEnd/src/app/http/user.ts | 52 |
7 files changed, 104 insertions, 438 deletions
diff --git a/FrontEnd/src/app/http/bookmark.ts b/FrontEnd/src/app/http/bookmark.ts index 15e55d98..3e5be229 100644 --- a/FrontEnd/src/app/http/bookmark.ts +++ b/FrontEnd/src/app/http/bookmark.ts @@ -1,15 +1,6 @@ -import { - axios, - apiBaseUrl, - convertToNetworkError, - extractResponseData, -} from "./common"; +import { axios, apiBaseUrl, extractResponseData } from "./common"; -import { - HttpTimelineInfo, - processRawTimelineInfo, - RawHttpTimelineInfo, -} from "./timeline"; +import { HttpTimelineInfo } from "./timeline"; export interface HttpHighlightMoveRequest { timeline: string; @@ -26,31 +17,20 @@ export interface IHttpBookmarkClient { export class HttpHighlightClient implements IHttpBookmarkClient { list(): Promise<HttpTimelineInfo[]> { return axios - .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/bookmarks`) - .then(extractResponseData) - .then((list) => list.map(processRawTimelineInfo)) - .catch(convertToNetworkError); + .get<HttpTimelineInfo[]>(`${apiBaseUrl}/bookmarks`) + .then(extractResponseData); } put(timeline: string): Promise<void> { - return axios - .put(`${apiBaseUrl}/bookmarks/${timeline}`) - .catch(convertToNetworkError) - .then(); + return axios.put(`${apiBaseUrl}/bookmarks/${timeline}`).then(); } delete(timeline: string): Promise<void> { - return axios - .delete(`${apiBaseUrl}/bookmarks/${timeline}`) - .catch(convertToNetworkError) - .then(); + return axios.delete(`${apiBaseUrl}/bookmarks/${timeline}`).then(); } move(req: HttpHighlightMoveRequest): Promise<void> { - return axios - .post(`${apiBaseUrl}/bookmarkop/move`, req) - .catch(convertToNetworkError) - .then(); + return axios.post(`${apiBaseUrl}/bookmarkop/move`, req).then(); } } diff --git a/FrontEnd/src/app/http/common.ts b/FrontEnd/src/app/http/common.ts index 0f46280c..5c44e8e3 100644 --- a/FrontEnd/src/app/http/common.ts +++ b/FrontEnd/src/app/http/common.ts @@ -4,6 +4,45 @@ export const apiBaseUrl = "/api"; export const axios = rawAxios.create(); +function convertToNetworkError(error: AxiosError): never { + if (error.isAxiosError && error.response == null) { + throw new HttpNetworkError(error); + } else { + throw error; + } +} + +function convertToForbiddenError(error: AxiosError): never { + if ( + error.isAxiosError && + error.response != null && + (error.response.status == 401 || error.response.status == 403) + ) { + throw new HttpForbiddenError(error); + } else { + throw error; + } +} + +function convertToNotFoundError(error: AxiosError): never { + if ( + error.isAxiosError && + error.response != null && + error.response.status == 404 + ) { + throw new HttpNotFoundError(error); + } else { + throw error; + } +} + +rawAxios.interceptors.response.use(undefined, convertToNetworkError); +rawAxios.interceptors.response.use(undefined, convertToForbiddenError); +rawAxios.interceptors.response.use(undefined, convertToNotFoundError); +axios.interceptors.response.use(undefined, convertToNetworkError); +axios.interceptors.response.use(undefined, convertToForbiddenError); +axios.interceptors.response.use(undefined, convertToNotFoundError); + let _token: string | null = null; export function getHttpToken(): string | null { @@ -71,6 +110,12 @@ export class HttpForbiddenError extends Error { } } +export class HttpNotFoundError extends Error { + constructor(public innerError?: AxiosError) { + super(); + } +} + export class NotModified {} export interface BlobWithEtag { @@ -135,30 +180,6 @@ export function convertToIfErrorCodeIs<NewError>( }); } -export function convertToNetworkError( - error: AxiosError<CommonErrorResponse> -): never { - if (error.isAxiosError && error.response == null) { - throw new HttpNetworkError(error); - } else { - throw error; - } -} - -export function convertToForbiddenError( - error: AxiosError<CommonErrorResponse> -): never { - if ( - error.isAxiosError && - error.response != null && - (error.response.status == 401 || error.response.status == 403) - ) { - throw new HttpForbiddenError(error); - } else { - throw error; - } -} - export function convertToNotModified( error: AxiosError<CommonErrorResponse> ): NotModified { diff --git a/FrontEnd/src/app/http/highlight.ts b/FrontEnd/src/app/http/highlight.ts index 851d52ce..fddf0729 100644 --- a/FrontEnd/src/app/http/highlight.ts +++ b/FrontEnd/src/app/http/highlight.ts @@ -1,15 +1,6 @@ -import { - axios, - apiBaseUrl, - convertToNetworkError, - extractResponseData, -} from "./common"; +import { axios, apiBaseUrl, extractResponseData } from "./common"; -import { - HttpTimelineInfo, - processRawTimelineInfo, - RawHttpTimelineInfo, -} from "./timeline"; +import { HttpTimelineInfo } from "./timeline"; export interface HttpHighlightMoveRequest { timeline: string; @@ -26,31 +17,20 @@ export interface IHttpHighlightClient { export class HttpHighlightClient implements IHttpHighlightClient { list(): Promise<HttpTimelineInfo[]> { return axios - .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/highlights`) - .then(extractResponseData) - .then((list) => list.map(processRawTimelineInfo)) - .catch(convertToNetworkError); + .get<HttpTimelineInfo[]>(`${apiBaseUrl}/highlights`) + .then(extractResponseData); } put(timeline: string): Promise<void> { - return axios - .put(`${apiBaseUrl}/highlights/${timeline}`) - .catch(convertToNetworkError) - .then(); + return axios.put(`${apiBaseUrl}/highlights/${timeline}`).then(); } delete(timeline: string): Promise<void> { - return axios - .delete(`${apiBaseUrl}/highlights/${timeline}`) - .catch(convertToNetworkError) - .then(); + return axios.delete(`${apiBaseUrl}/highlights/${timeline}`).then(); } move(req: HttpHighlightMoveRequest): Promise<void> { - return axios - .post(`${apiBaseUrl}/highlightop/move`, req) - .catch(convertToNetworkError) - .then(); + return axios.post(`${apiBaseUrl}/highlightop/move`, req).then(); } } diff --git a/FrontEnd/src/app/http/search.ts b/FrontEnd/src/app/http/search.ts index 2da9295e..8ca48fe9 100644 --- a/FrontEnd/src/app/http/search.ts +++ b/FrontEnd/src/app/http/search.ts @@ -1,14 +1,5 @@ -import { - apiBaseUrl, - axios, - convertToNetworkError, - extractResponseData, -} from "./common"; -import { - HttpTimelineInfo, - processRawTimelineInfo, - RawHttpTimelineInfo, -} from "./timeline"; +import { apiBaseUrl, axios, extractResponseData } from "./common"; +import { HttpTimelineInfo } from "./timeline"; import { HttpUser } from "./user"; export interface IHttpSearchClient { @@ -19,17 +10,14 @@ export interface IHttpSearchClient { export class HttpSearchClient implements IHttpSearchClient { searchTimelines(query: string): Promise<HttpTimelineInfo[]> { return axios - .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/search/timelines?q=${query}`) - .then(extractResponseData) - .then((ts) => ts.map(processRawTimelineInfo)) - .catch(convertToNetworkError); + .get<HttpTimelineInfo[]>(`${apiBaseUrl}/search/timelines?q=${query}`) + .then(extractResponseData); } searchUsers(query: string): Promise<HttpUser[]> { return axios .get<HttpUser[]>(`${apiBaseUrl}/search/users?q=${query}`) - .then(extractResponseData) - .catch(convertToNetworkError); + .then(extractResponseData); } } diff --git a/FrontEnd/src/app/http/timeline.ts b/FrontEnd/src/app/http/timeline.ts index 68fee5ae..a84a40ef 100644 --- a/FrontEnd/src/app/http/timeline.ts +++ b/FrontEnd/src/app/http/timeline.ts @@ -6,15 +6,7 @@ import { axios, apiBaseUrl, extractResponseData, - convertToNetworkError, - base64, - convertToIfStatusCodeIs, convertToIfErrorCodeIs, - BlobWithEtag, - NotModified, - convertToNotModified, - convertToForbiddenError, - convertToBlobWithEtag, } from "./common"; import { HttpUser } from "./user"; @@ -29,7 +21,8 @@ export interface HttpTimelineInfo { description: string; owner: HttpUser; visibility: TimelineVisibility; - lastModified: Date; + color: string; + lastModified: string; members: HttpUser[]; isHighlight: boolean; isBookmark: boolean; @@ -45,57 +38,28 @@ export interface HttpTimelinePostRequest { name: string; } -export interface HttpTimelinePostTextContent { - type: "text"; - text: string; -} - -export interface HttpTimelinePostImageContent { - type: "image"; +export interface HttpTimelinePostDataDigest { + kind: string; + eTag: string; + lastUpdated: string; } -export type HttpTimelinePostContent = - | HttpTimelinePostTextContent - | HttpTimelinePostImageContent; - export interface HttpTimelinePostInfo { id: number; - content: HttpTimelinePostContent; - time: Date; - lastUpdated: Date; + time: string; author: HttpUser; - deleted: false; -} - -export interface HttpTimelineDeletedPostInfo { - id: number; - time: Date; - lastUpdated: Date; - author?: HttpUser; - deleted: true; -} - -export type HttpTimelineGenericPostInfo = - | HttpTimelinePostInfo - | HttpTimelineDeletedPostInfo; - -export interface HttpTimelinePostPostRequestTextContent { - type: "text"; - text: string; -} - -export interface HttpTimelinePostPostRequestImageContent { - type: "image"; - data: Blob; + dataList: HttpTimelinePostDataDigest; + color: string; + lastUpdated: string; } -export type HttpTimelinePostPostRequestContent = - | HttpTimelinePostPostRequestTextContent - | HttpTimelinePostPostRequestImageContent; - export interface HttpTimelinePostPostRequest { - content: HttpTimelinePostPostRequestContent; - time?: Date; + time?: string; + color?: string; + dataList: { + contentType: string; + data: string; + }[]; } export interface HttpTimelinePatchRequest { @@ -105,120 +69,12 @@ export interface HttpTimelinePatchRequest { description?: string; } -export class HttpTimelineNotExistError extends Error { - constructor(public innerError?: AxiosError) { - super(); - } -} - -export class HttpTimelinePostNotExistError extends Error { - constructor(public innerError?: AxiosError) { - super(); - } -} - export class HttpTimelineNameConflictError extends Error { constructor(public innerError?: AxiosError) { super(); } } -//-------------------- begin: internal model -------------------- - -export interface RawHttpTimelineInfo { - uniqueId: string; - title: string; - name: string; - description: string; - owner: HttpUser; - visibility: TimelineVisibility; - lastModified: string; - members: HttpUser[]; - isHighlight: boolean; - isBookmark: boolean; -} - -interface RawTimelinePostTextContent { - type: "text"; - text: string; -} - -interface RawTimelinePostImageContent { - type: "image"; - url: string; -} - -type RawTimelinePostContent = - | RawTimelinePostTextContent - | RawTimelinePostImageContent; - -interface RawTimelinePostInfo { - id: number; - content: RawTimelinePostContent; - time: string; - lastUpdated: string; - author: HttpUser; - deleted: false; -} - -interface RawTimelineDeletedPostInfo { - id: number; - time: string; - lastUpdated: string; - author: HttpUser; - deleted: true; -} - -type RawTimelineGenericPostInfo = - | RawTimelinePostInfo - | RawTimelineDeletedPostInfo; - -interface RawTimelinePostPostRequestTextContent { - type: "text"; - text: string; -} - -interface RawTimelinePostPostRequestImageContent { - type: "image"; - data: string; -} - -type RawTimelinePostPostRequestContent = - | RawTimelinePostPostRequestTextContent - | RawTimelinePostPostRequestImageContent; - -interface RawTimelinePostPostRequest { - content: RawTimelinePostPostRequestContent; - time?: string; -} - -//-------------------- end: internal model -------------------- - -export function processRawTimelineInfo( - raw: RawHttpTimelineInfo -): HttpTimelineInfo { - return { - ...raw, - lastModified: new Date(raw.lastModified), - }; -} - -function processRawTimelinePostInfo( - raw: RawTimelinePostInfo -): HttpTimelinePostInfo; -function processRawTimelinePostInfo( - raw: RawTimelineGenericPostInfo -): HttpTimelineGenericPostInfo; -function processRawTimelinePostInfo( - raw: RawTimelineGenericPostInfo -): HttpTimelineGenericPostInfo { - return { - ...raw, - time: new Date(raw.time), - lastUpdated: new Date(raw.lastUpdated), - }; -} - export interface IHttpTimelineClient { listTimeline(query: HttpTimelineListQuery): Promise<HttpTimelineInfo[]>; getTimeline(timelineName: string): Promise<HttpTimelineInfo>; @@ -231,26 +87,6 @@ export interface IHttpTimelineClient { memberPut(timelineName: string, username: string): Promise<void>; memberDelete(timelineName: string, username: string): Promise<void>; listPost(timelineName: string): Promise<HttpTimelinePostInfo[]>; - listPost( - timelineName: string, - query: { - modifiedSince?: Date; - includeDeleted?: false; - } - ): Promise<HttpTimelinePostInfo[]>; - listPost( - timelineName: string, - query: { - modifiedSince?: Date; - includeDeleted: true; - } - ): Promise<HttpTimelineGenericPostInfo[]>; - getPostData(timelineName: string, postId: number): Promise<BlobWithEtag>; - getPostData( - timelineName: string, - postId: number, - etag: string - ): Promise<BlobWithEtag | NotModified>; postPost( timelineName: string, req: HttpTimelinePostPostRequest @@ -261,30 +97,23 @@ export interface IHttpTimelineClient { export class HttpTimelineClient implements IHttpTimelineClient { listTimeline(query: HttpTimelineListQuery): Promise<HttpTimelineInfo[]> { return axios - .get<RawHttpTimelineInfo[]>( + .get<HttpTimelineInfo[]>( applyQueryParameters(`${apiBaseUrl}/timelines`, query) ) - .then(extractResponseData) - .then((list) => list.map(processRawTimelineInfo)) - .catch(convertToNetworkError); + .then(extractResponseData); } getTimeline(timelineName: string): Promise<HttpTimelineInfo> { return axios - .get<RawHttpTimelineInfo>(`${apiBaseUrl}/timelines/${timelineName}`) - .then(extractResponseData) - .then(processRawTimelineInfo) - .catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError)) - .catch(convertToNetworkError); + .get<HttpTimelineInfo>(`${apiBaseUrl}/timelines/${timelineName}`) + .then(extractResponseData); } postTimeline(req: HttpTimelinePostRequest): Promise<HttpTimelineInfo> { return axios - .post<RawHttpTimelineInfo>(`${apiBaseUrl}/timelines`, req) + .post<HttpTimelineInfo>(`${apiBaseUrl}/timelines`, req) .then(extractResponseData) - .then(processRawTimelineInfo) - .catch(convertToIfErrorCodeIs(11040101, HttpTimelineNameConflictError)) - .catch(convertToNetworkError); + .catch(convertToIfErrorCodeIs(11040101, HttpTimelineNameConflictError)); } patchTimeline( @@ -292,134 +121,49 @@ export class HttpTimelineClient implements IHttpTimelineClient { req: HttpTimelinePatchRequest ): Promise<HttpTimelineInfo> { return axios - .patch<RawHttpTimelineInfo>( - `${apiBaseUrl}/timelines/${timelineName}`, - req - ) - .then(extractResponseData) - .then(processRawTimelineInfo) - .catch(convertToNetworkError); + .patch<HttpTimelineInfo>(`${apiBaseUrl}/timelines/${timelineName}`, req) + .then(extractResponseData); } deleteTimeline(timelineName: string): Promise<void> { - return axios - .delete(`${apiBaseUrl}/timelines/${timelineName}`) - .catch(convertToNetworkError) - .then(); + return axios.delete(`${apiBaseUrl}/timelines/${timelineName}`).then(); } memberPut(timelineName: string, username: string): Promise<void> { return axios .put(`${apiBaseUrl}/timelines/${timelineName}/members/${username}`) - .catch(convertToNetworkError) .then(); } memberDelete(timelineName: string, username: string): Promise<void> { return axios .delete(`${apiBaseUrl}/timelines/${timelineName}/members/${username}`) - .catch(convertToNetworkError) .then(); } - listPost(timelineName: string): Promise<HttpTimelinePostInfo[]>; - listPost( - timelineName: string, - query: { - modifiedSince?: Date; - includeDeleted?: false; - } - ): Promise<HttpTimelinePostInfo[]>; - listPost( - timelineName: string, - query: { - modifiedSince?: Date; - includeDeleted: true; - } - ): Promise<HttpTimelineGenericPostInfo[]>; - listPost( - timelineName: string, - query?: { - modifiedSince?: Date; - includeDeleted?: boolean; - } - ): Promise<HttpTimelineGenericPostInfo[]> { + listPost(timelineName: string): Promise<HttpTimelinePostInfo[]> { return axios - .get<RawTimelineGenericPostInfo[]>( - applyQueryParameters( - `${apiBaseUrl}/timelines/${timelineName}/posts`, - query - ) + .get<HttpTimelinePostInfo[]>( + `${apiBaseUrl}/timelines/${timelineName}/posts` ) - .then(extractResponseData) - .catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError)) - .catch(convertToForbiddenError) - .catch(convertToNetworkError) - .then((rawPosts) => - rawPosts.map((raw) => processRawTimelinePostInfo(raw)) - ); - } - - getPostData(timelineName: string, postId: number): Promise<BlobWithEtag>; - getPostData( - timelineName: string, - postId: number, - etag?: string - ): Promise<BlobWithEtag | NotModified> { - const headers = - etag != null - ? { - "If-None-Match": etag, - } - : undefined; - - const url = `${apiBaseUrl}/timelines/${timelineName}/posts/${postId}/data`; - - return axios - .get(url, { - responseType: "blob", - headers, - }) - .then(convertToBlobWithEtag) - .catch(convertToNotModified) - .catch(convertToIfStatusCodeIs(404, HttpTimelinePostNotExistError)) - .catch(convertToNetworkError); + .then(extractResponseData); } - async postPost( + postPost( timelineName: string, req: HttpTimelinePostPostRequest ): Promise<HttpTimelinePostInfo> { - let content: RawTimelinePostPostRequestContent; - if (req.content.type === "image") { - const base64Data = await base64(req.content.data); - content = { - ...req.content, - data: base64Data, - } as RawTimelinePostPostRequestImageContent; - } else { - content = req.content; - } - const rawReq: RawTimelinePostPostRequest = { - content, - }; - if (req.time != null) { - rawReq.time = req.time.toISOString(); - } - return await axios - .post<RawTimelinePostInfo>( + return axios + .post<HttpTimelinePostInfo>( `${apiBaseUrl}/timelines/${timelineName}/posts`, - rawReq + req ) - .then(extractResponseData) - .catch(convertToNetworkError) - .then((rawPost) => processRawTimelinePostInfo(rawPost)); + .then(extractResponseData); } deletePost(timelineName: string, postId: number): Promise<void> { return axios .delete(`${apiBaseUrl}/timelines/${timelineName}/posts/${postId}`) - .catch(convertToNetworkError) .then(); } } diff --git a/FrontEnd/src/app/http/token.ts b/FrontEnd/src/app/http/token.ts index c0644515..f8b09d63 100644 --- a/FrontEnd/src/app/http/token.ts +++ b/FrontEnd/src/app/http/token.ts @@ -4,7 +4,6 @@ import axios, { AxiosError } from "axios"; import { apiBaseUrl, - convertToNetworkError, convertToIfErrorCodeIs, extractResponseData, } from "./common"; @@ -47,15 +46,13 @@ export class HttpTokenClient implements IHttpTokenClient { .then(extractResponseData) .catch( convertToIfErrorCodeIs(11010101, HttpCreateTokenBadCredentialError) - ) - .catch(convertToNetworkError); + ); } verify(req: HttpVerifyTokenRequest): Promise<HttpVerifyTokenResponse> { return axios .post<HttpVerifyTokenResponse>(`${apiBaseUrl}/token/verify`, req) - .then(extractResponseData) - .catch(convertToNetworkError); + .then(extractResponseData); } } diff --git a/FrontEnd/src/app/http/user.ts b/FrontEnd/src/app/http/user.ts index 19accc42..c6a567d3 100644 --- a/FrontEnd/src/app/http/user.ts +++ b/FrontEnd/src/app/http/user.ts @@ -3,14 +3,9 @@ import { AxiosError } from "axios"; import { axios, apiBaseUrl, - convertToNetworkError, extractResponseData, convertToIfStatusCodeIs, convertToIfErrorCodeIs, - NotModified, - BlobWithEtag, - convertToBlobWithEtag, - convertToNotModified, extractEtag, } from "./common"; @@ -66,11 +61,6 @@ export interface IHttpUserClient { get(username: string): Promise<HttpUser>; patch(username: string, req: HttpUserPatchRequest): Promise<HttpUser>; delete(username: string): Promise<void>; - getAvatar(username: string): Promise<BlobWithEtag>; - getAvatar( - username: string, - etag: string - ): Promise<BlobWithEtag | NotModified>; // return etag putAvatar(username: string, data: Blob): Promise<string>; changePassword(req: HttpChangePasswordRequest): Promise<void>; @@ -90,53 +80,24 @@ export class HttpUserClient implements IHttpUserClient { list(): Promise<HttpUser[]> { return axios .get<HttpUser[]>(`${apiBaseUrl}/users`) - .then(extractResponseData) - .catch(convertToNetworkError); + .then(extractResponseData); } get(username: string): Promise<HttpUser> { return axios .get<HttpUser>(`${apiBaseUrl}/users/${username}`) .then(extractResponseData) - .catch(convertToIfStatusCodeIs(404, HttpUserNotExistError)) - .catch(convertToNetworkError); + .catch(convertToIfStatusCodeIs(404, HttpUserNotExistError)); } patch(username: string, req: HttpUserPatchRequest): Promise<HttpUser> { return axios .patch<HttpUser>(`${apiBaseUrl}/users/${username}`, req) - .then(extractResponseData) - .catch(convertToNetworkError); + .then(extractResponseData); } delete(username: string): Promise<void> { - return axios - .delete(`${apiBaseUrl}/users/${username}`) - .catch(convertToNetworkError) - .then(); - } - - getAvatar(username: string): Promise<BlobWithEtag>; - getAvatar( - username: string, - etag?: string - ): Promise<BlobWithEtag | NotModified> { - const headers = - etag != null - ? { - "If-None-Match": etag, - } - : undefined; - - return axios - .get(`${apiBaseUrl}/users/${username}/avatar`, { - responseType: "blob", - headers, - }) - .then(convertToBlobWithEtag) - .catch(convertToNotModified) - .catch(convertToIfStatusCodeIs(404, HttpUserNotExistError)) - .catch(convertToNetworkError); + return axios.delete(`${apiBaseUrl}/users/${username}`).then(); } putAvatar(username: string, data: Blob): Promise<string> { @@ -146,7 +107,6 @@ export class HttpUserClient implements IHttpUserClient { "Content-Type": data.type, }, }) - .catch(convertToNetworkError) .then(extractEtag); } @@ -156,7 +116,6 @@ export class HttpUserClient implements IHttpUserClient { .catch( convertToIfErrorCodeIs(11020201, HttpChangePasswordBadCredentialError) ) - .catch(convertToNetworkError) .then(); } @@ -166,7 +125,6 @@ export class HttpUserClient implements IHttpUserClient { ): Promise<void> { return axios .put(`${apiBaseUrl}/users/${username}/permissions/${permission}`) - .catch(convertToNetworkError) .then(); } @@ -176,7 +134,6 @@ export class HttpUserClient implements IHttpUserClient { ): Promise<void> { return axios .delete(`${apiBaseUrl}/users/${username}/permissions/${permission}`) - .catch(convertToNetworkError) .then(); } @@ -184,7 +141,6 @@ export class HttpUserClient implements IHttpUserClient { return axios .post<HttpUser>(`${apiBaseUrl}/userop/createuser`, req) .then(extractResponseData) - .catch(convertToNetworkError) .then(); } } |