mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +00:00
Make sure siteIds are numbers
Fixes PAN-145
This commit is contained in:
@@ -29,7 +29,7 @@ const updateClientSchema = z
|
||||
.object({
|
||||
name: z.string().min(1).max(255).optional(),
|
||||
siteIds: z
|
||||
.array(z.string().transform(Number).pipe(z.number()))
|
||||
.array(z.number().int().positive())
|
||||
.optional()
|
||||
})
|
||||
.strict();
|
||||
|
||||
@@ -115,7 +115,7 @@ export default function GeneralPage() {
|
||||
try {
|
||||
await api.post(`/client/${client?.clientId}`, {
|
||||
name: data.name,
|
||||
siteIds: data.siteIds.map(site => site.id)
|
||||
siteIds: data.siteIds.map(site => parseInt(site.id))
|
||||
});
|
||||
|
||||
updateClient({ name: data.name });
|
||||
|
||||
Reference in New Issue
Block a user