mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-13 20:10:07 +02:00
add isAdmin to auth state
This commit is contained in:
@@ -140,6 +140,7 @@ const LoginRoute = () => {
|
||||
const serverItem: ServerListItemWithCredential = {
|
||||
credential: data.credential,
|
||||
id: nanoid(),
|
||||
isAdmin: data.isAdmin,
|
||||
name: serverName,
|
||||
type: serverType as ServerType,
|
||||
url: serverUrl.replace(/\/$/, ''),
|
||||
|
||||
@@ -156,6 +156,7 @@ export const AddServerForm = ({ onCancel }: AddServerFormProps) => {
|
||||
const serverItem: ServerListItemWithCredential = {
|
||||
credential: data.credential,
|
||||
id: nanoid(),
|
||||
isAdmin: data.isAdmin,
|
||||
name: values.name,
|
||||
type: values.type as ServerType,
|
||||
url: values.url.replace(/\/$/, ''),
|
||||
|
||||
@@ -50,6 +50,7 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
|
||||
|
||||
const form = useForm({
|
||||
initialValues: {
|
||||
isAdmin: server?.isAdmin,
|
||||
legacyAuth: false,
|
||||
name: server?.name,
|
||||
password: password || '',
|
||||
@@ -94,6 +95,7 @@ export const EditServerForm = ({ isUpdate, onCancel, password, server }: EditSer
|
||||
const serverItem: ServerListItemWithCredential = {
|
||||
credential: data.credential,
|
||||
id: server.id,
|
||||
isAdmin: data.isAdmin,
|
||||
name: values.name,
|
||||
type: values.type,
|
||||
url: values.url,
|
||||
|
||||
Reference in New Issue
Block a user