From 63b400627b98fc4d3885c0c004d6762c9422ece2 Mon Sep 17 00:00:00 2001 From: Presley Pizzo <1290996+presleyp@users.noreply.github.com> Date: Mon, 4 Apr 2022 18:02:27 -0400 Subject: [PATCH] chore(site): fix typegen usage (#868) --- site/src/xServices/user/userXService.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/site/src/xServices/user/userXService.ts b/site/src/xServices/user/userXService.ts index bcbbe12868..150f89b8a8 100644 --- a/site/src/xServices/user/userXService.ts +++ b/site/src/xServices/user/userXService.ts @@ -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,