change how we create/edit clients

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-12 20:32:12 +02:00
committed by Carl-Gerhard Lindesvärd
parent 7f8d857508
commit bface463e2
16 changed files with 243 additions and 159 deletions

View File

@@ -18,7 +18,7 @@ type EditClientProps = IServiceClient;
const validator = z.object({
id: z.string().min(1),
name: z.string().min(1),
cors: z.string().min(1),
cors: z.string().nullable(),
});
type IForm = z.infer<typeof validator>;
@@ -59,13 +59,11 @@ export default function EditClient({ id, name, cors }: EditClientProps) {
label="Name"
placeholder="Name"
{...register('name')}
defaultValue={name}
/>
<InputWithLabel
label="Cors"
placeholder="Cors"
{...register('cors')}
defaultValue={cors}
/>
</div>
<ButtonContainer>