Complete platform management workflows
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import type { UserResponse, UserStatus } from "../api/types";
|
||||
|
||||
export type UserListSource = "api" | "local-development";
|
||||
export type UserRemovalAction = "deactivate";
|
||||
|
||||
export interface UserEditFormState {
|
||||
displayName: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
qq: string;
|
||||
contactNote: string;
|
||||
roles: string[];
|
||||
status: UserStatus;
|
||||
}
|
||||
|
||||
export interface UserRemovalConfirmationState {
|
||||
action: UserRemovalAction;
|
||||
user: UserResponse;
|
||||
}
|
||||
|
||||
export function userEditFormFromResponse(user: UserResponse): UserEditFormState {
|
||||
return {
|
||||
displayName: user.displayName,
|
||||
email: user.email ?? "",
|
||||
phone: user.profile?.phone ?? "",
|
||||
qq: user.profile?.qq ?? "",
|
||||
contactNote: user.profile?.contactNote ?? "",
|
||||
roles: [...user.roles],
|
||||
status: user.status
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user