-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Finish prototype deployment process
- Loading branch information
1 parent
c789f31
commit 79a2b6b
Showing
5 changed files
with
147 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
import { UseGlobalSession } from '../../Global'; | ||
|
||
export default function DeployRequest(endpoint: string, location: string, body: string) { | ||
export default async function DeployRequest( | ||
endpoint: string, | ||
location: string, | ||
body: any | ||
) { | ||
const url = endpoint + '/' + location; | ||
|
||
return fetch(url, { | ||
method: 'POST', | ||
body: body | ||
}) | ||
.then(x => x.json()) | ||
.then(x => console.log(x)) | ||
.catch(x => { | ||
console.error(x); | ||
throw x; | ||
try { | ||
const x = await fetch(url, { | ||
method: 'POST', | ||
body: JSON.stringify(body), | ||
headers: { | ||
'Content-Type': 'application/json' | ||
} | ||
}).then(r => { | ||
if (r.ok) { | ||
return r.json() | ||
} | ||
|
||
throw new Error('API returned not OK') | ||
}); | ||
return console.log(x); | ||
} catch (e) { | ||
console.error(e); | ||
throw e; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
declare module 'rc-steps' { | ||
export default class Steps extends React.Component<{current: number, direction?: string, size?: string}> { | ||
static Step = class Step extends React.Component<{title: string, description: string, icon?: any}> {} | ||
export default class Steps extends React.Component<{current: number, direction?: string, size?: string, icons?: any}> { | ||
static Step = class Step extends React.Component<{title: string, description: string, icon?: any, ref?: any}> {} | ||
} | ||
} |