Commit f67213e5 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Minor types and unused imports.

parent 42ff39bf
import { apiBase, objectsBase } from './config'
import { apiBase } from './config'
const networkError = () => {
throw 'Network related error, cannot reach API or object storage.'
throw Error('Network related error, cannot reach API or object storage.')
}
const handleResponseErrors = (response) => {
if (!response.ok) {
throw `API/object storage error (${response.statusCode}): ${response.statusText}`
throw Error(`API/object storage error (${response.statusCode}): ${response.statusText}`)
}
return response
}
class Upload {
constructor(json) {
console.debug('Created local upload for ' + json.upload_id)
Object.assign(this, json)
}
uploadFile(file) {
console.assert(this.presigned_url)
console.debug(`Upload ${file} to ${this.presigned_url}.`)
const url = this.presigned_url.replace('https://localhost:9000', objectsBase)
return fetch(this.presigned_url, {
method: 'PUT',
headers: {
......@@ -44,7 +41,6 @@ class Upload {
}
function createUpload(name) {
console.debug('Request new upload.')
const fetchData = {
method: 'POST',
body: JSON.stringify({
......
......@@ -4,7 +4,7 @@ import { withRouter } from 'react-router-dom'
import { HashLink as Link } from 'react-router-hash-link'
import './Documentation.css'
import Url from 'url-parse'
import { apiBase, appBase } from '../config'
import { apiBase } from '../config'
const processNodeDefinitions = new HtmlToReact.ProcessNodeDefinitions(React)
const processingInstructions = location => {
......
......@@ -54,7 +54,6 @@ class Upload extends React.Component {
window.setTimeout(() => {
this.state.upload.update()
.then(upload => {
console.debug(`Sucessfully updated upload ${upload.upload_id}.`)
console.assert(upload.proc, 'Uploads always must have a proc')
this.setState({upload: upload})
if (upload.proc.status !== 'SUCCESS') {
......
import React from "react"
import { SnackbarContent, IconButton, Snackbar, withStyles, Typography } from "@material-ui/core";
import { SnackbarContent, IconButton, Snackbar, withStyles } from "@material-ui/core";
import ErrorIcon from '@material-ui/icons/Error'
import CloseIcon from '@material-ui/icons/Close'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment