migrate ui-components from flow to typescript

This commit is contained in:
Sebastian Sdorra
2019-10-20 16:59:02 +02:00
parent c41efbdc4f
commit f49e17a3a7
151 changed files with 2039 additions and 25265 deletions

View File

@@ -54,19 +54,19 @@ export class ForbiddenError extends Error {
export class NotFoundError extends BackendError {
constructor(content: BackendErrorContent, statusCode: number) {
super(content, 'NotFoundError', statusCode);
super(content, "NotFoundError", statusCode);
}
}
export class ConflictError extends BackendError {
constructor(content: BackendErrorContent, statusCode: number) {
super(content, 'ConflictError', statusCode);
super(content, "ConflictError", statusCode);
}
}
export function createBackendError(
content: BackendErrorContent,
statusCode: number,
statusCode: number
) {
switch (statusCode) {
case 404:
@@ -74,13 +74,13 @@ export function createBackendError(
case 409:
return new ConflictError(content, statusCode);
default:
return new BackendError(content, 'BackendError', statusCode);
return new BackendError(content, "BackendError", statusCode);
}
}
export function isBackendError(response: Response) {
return (
response.headers.get('Content-Type') ===
'application/vnd.scmm-error+json;v=2'
response.headers.get("Content-Type") ===
"application/vnd.scmm-error+json;v=2"
);
}