chore(site): fix typegen usage (#868)

This commit is contained in:
Presley Pizzo
2022-04-04 18:02:27 -04:00
committed by GitHub
parent 8a1ae18ede
commit 63b400627b
+4 -6
View File
@@ -3,7 +3,7 @@ import * as Types from "../../api/types"
import * as API from "../../api"
export interface UserContext {
getUserError?: Error | unknown // unknown is a concession while I work out typing issues
getUserError?: Error | unknown
authError?: Error | unknown
me?: Types.UserResponse
}
@@ -23,7 +23,7 @@ export const userMachine =
data: Types.UserResponse
}
signIn: {
data: Types.LoginResponse | undefined
data: Types.LoginResponse
}
},
},
@@ -110,10 +110,8 @@ export const userMachine =
},
{
services: {
signIn: async (_, event: UserEvent) => {
if (event.type === "SIGN_IN") {
return await API.login(event.email, event.password)
}
signIn: async (_, event) => {
return await API.login(event.email, event.password)
},
signOut: API.logout,
getMe: API.getUser,