mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-02-04 12:40:08 +00:00
fix validation & implement profile page (#5)
* fix validation * implement profile page * catch error
This commit is contained in:
@@ -37,9 +37,7 @@ interface ServerGroupCardProps {
|
||||
|
||||
const serverGroupFormSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
servers: z.array(z.string()).transform((v => {
|
||||
return v.filter(Boolean).map(Number);
|
||||
})),
|
||||
servers: z.array(z.number()),
|
||||
});
|
||||
|
||||
export const ServerGroupCard: React.FC<ServerGroupCardProps> = ({ data, mutate }) => {
|
||||
@@ -116,7 +114,10 @@ export const ServerGroupCard: React.FC<ServerGroupCardProps> = ({ data, mutate }
|
||||
<FormControl>
|
||||
<MultiSelect
|
||||
options={serverList}
|
||||
onValueChange={field.onChange}
|
||||
onValueChange={e => {
|
||||
const arr = e.map(Number);
|
||||
field.onChange(arr);
|
||||
}}
|
||||
defaultValue={field.value?.map(String)}
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
Reference in New Issue
Block a user