feat(SW-160): update profile
This commit is contained in:
committed by
Michael Zetterberg
parent
b6e22d51a5
commit
2337d37f1a
@@ -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
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user