Skip to content

Commit

Permalink
fix a couple of bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Mar 24, 2021
1 parent 82cdbd2 commit 4e420ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ function App(props) {
React.useEffect(() => {
let params = (new URL(document.location)).searchParams;
let requestedCollabId = params.get('collab_id');
setCurrentCollab(requestedCollabId);
if (requestedCollabId) {
setCurrentCollab(requestedCollabId);
}
console.log(`Requested ${requestedCollabId}`);
});

Expand Down
7 changes: 5 additions & 2 deletions src/Queue/CreateJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export default function CreateJob(props) {
const [git, setGit] = React.useState('');
const [mymodel, setModel] = React.useState('');
const [tags, setTags] = React.useState([])
const [errorMessage, setErrorMessage] = React.useState('');


useEffect(() => {
Expand Down Expand Up @@ -230,7 +231,6 @@ function handleSubmit(){
status : 'submitted',
code : mymodel,
command : command,
hardware_config: JSON.parse(hardwareConfig),
hardware_platform : hw,
collab_id: props.collab,
tags : tags,
Expand All @@ -242,6 +242,9 @@ function handleSubmit(){
// job.resource_uri = "";
// inputs = [];
}
if (hardwareConfig) {
job.hardware_config = JSON.parse(hardwareConfig);
}
console.log(job.hardware_platform)

axios.post(Url, job, requestConfig)
Expand All @@ -250,7 +253,7 @@ function handleSubmit(){
})
.catch(error => {
console.log(error)
this.setState({errorMsg: 'Error submitting a job'})
setErrorMessage('Error submitting a job');
})
}

Expand Down

0 comments on commit 4e420ab

Please sign in to comment.