feat(SW-160): update profile

This commit is contained in:
Simon Emanuelsson
2024-07-17 16:12:18 +02:00
committed by Michael Zetterberg
parent b6e22d51a5
commit 2337d37f1a
32 changed files with 459 additions and 244 deletions

View File

@@ -4,25 +4,31 @@ export type EditFormProps = {
user: User
}
type E = {
message: string
path: string
}
export const enum Status {
error = "error",
success = "success",
}
type ErrorState = {
errors?: E[]
type Data = Record<
string,
string | undefined | Record<string, string | undefined>
>
type Issue = {
field: string
message: string
status: Status.error
}
type SuccessState = {
export type State = {
data: Data
message: string
status: Status.success
}
export type State = ErrorState | SuccessState | null
} & (
| {
issues: never
status: Status.success
}
| {
issues: Issue[]
status: Status.error
}
)