fixes empty trail category in lists
This commit is contained in:
@@ -20,7 +20,7 @@ const TrailCreateSchema = z.object({
|
||||
thumbnail: z.number().int().nonnegative().optional(),
|
||||
waypoints: z.array(z.string()).default([]),
|
||||
summit_logs: z.array(z.string()).default([]),
|
||||
category: z.string().length(15).optional(),
|
||||
category: z.string().length(15).optional().or(z.literal('')),
|
||||
gpx: z.string().optional(),
|
||||
author: z.string().length(15),
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@
|
||||
if (
|
||||
(data.list?.public === false && $formData.public === true) ||
|
||||
($formData.public === true &&
|
||||
data.list?.expand?.trails?.length !==
|
||||
$formData.expand?.trails?.length)
|
||||
(data.list?.expand?.trails?.length ?? 0) <
|
||||
($formData.expand?.trails?.length ?? 0))
|
||||
) {
|
||||
publishConfirmModal.openModal();
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user