pixiebrix-extension
pixiebrix-extension copied to clipboard
DX: Simplify the `UserData` type, and cleanup other types in `src/auth/authTypes.ts`
-
This change means that we can now simplify the
UserDatatype, it doesn't need to usePartialeverywhere anymore, since we're no longer handling the "anonymous user" situation with the/api/meendpoint returning "empty" user data. - This simplification can be propagated into the user data storage/update logic
- We should separate the types better between user info that can be updated, versus not, and we can get rid of this crazy type:
type UserDataUpdate = Required<Except<UserData, "hostname" | "user">>; - Clean up/fix the type weirdness around
OrganizationAuthStateandAuthUserOrganization- Fix this factory: https://github.com/pixiebrix/pixiebrix-extension/blob/main/src/testUtils/factories/authFactories.ts#L92-L95
- Should not be using the two org types interchangeably like this