File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ export interface Project {
39
39
active_version_id : string
40
40
}
41
41
42
- > >>> >>> main
43
42
export const login = async ( email : string , password : string ) : Promise < LoginResponse > => {
44
43
const response = await fetch ( "/api/v2/login" , {
45
44
method : "POST" ,
Original file line number Diff line number Diff line change @@ -52,4 +52,4 @@ const useStyles = makeStyles({
52
52
hintText : {
53
53
opacity : 0.75 ,
54
54
} ,
55
- } )
55
+ } )
Original file line number Diff line number Diff line change 1
1
import React from "react"
2
2
import { makeStyles } from "@material-ui/core/styles"
3
+ import { useRouter } from "next/router"
3
4
import useSWR from "swr"
4
5
5
6
import { provisioners } from "../../api"
@@ -8,6 +9,7 @@ import { FullScreenLoader } from "../../components/Loader/FullScreenLoader"
8
9
import { CreateProjectForm } from "../../forms/CreateProjectForm"
9
10
10
11
const CreateProjectPage : React . FC = ( ) => {
12
+ const router = useRouter ( )
11
13
const styles = useStyles ( )
12
14
const { me } = useUser ( true )
13
15
const { data : organizations , error } = useSWR ( "/api/v2/users/me/organizations" )
@@ -21,13 +23,17 @@ const CreateProjectPage: React.FC = () => {
21
23
return < FullScreenLoader />
22
24
}
23
25
26
+ const onCancel = async ( ) => {
27
+ await router . push ( "/projects" )
28
+ }
29
+
24
30
return (
25
31
< div className = { styles . root } >
26
32
< CreateProjectForm
27
33
provisioners = { provisioners }
28
34
organizations = { organizations }
29
35
onSubmit = { ( request ) => alert ( JSON . stringify ( request ) ) }
30
- onCancel = { ( ) => alert ( "Cancelled" ) }
36
+ onCancel = { onCancel }
31
37
/>
32
38
</ div >
33
39
)
You can’t perform that action at this time.
0 commit comments