fix: remove mandatory
All checks were successful
Build and deploy / build-deploy (push) Successful in 1m51s
All checks were successful
Build and deploy / build-deploy (push) Successful in 1m51s
This commit is contained in:
@@ -80,7 +80,7 @@ model Booking {
|
|||||||
|
|
||||||
// Organization
|
// Organization
|
||||||
orgName String
|
orgName String
|
||||||
orgNumber String
|
orgNumber String?
|
||||||
|
|
||||||
// Invoice address
|
// Invoice address
|
||||||
address String
|
address String
|
||||||
|
|||||||
@@ -26,47 +26,47 @@ export default async function AdminLayout({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-ink-50">
|
<div className="min-h-screen bg-ink-50">
|
||||||
<header className="border-b border-ink-200 bg-white">
|
<header className="border-b border-brand-700 bg-brand-600 text-white">
|
||||||
<div className="mx-auto flex max-w-6xl items-center justify-between gap-3 px-4 py-3">
|
<div className="mx-auto flex max-w-6xl items-center justify-between gap-3 px-4 py-3">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<Link href="/admin" className="text-base font-semibold text-ink-900">
|
<Link href="/admin" className="text-base font-semibold">
|
||||||
{t('title')}
|
{t('title')}
|
||||||
</Link>
|
</Link>
|
||||||
{session?.user && (
|
{session?.user && (
|
||||||
<nav className="hidden gap-1 sm:flex">
|
<nav className="hidden gap-1 sm:flex">
|
||||||
<Link
|
<Link
|
||||||
href="/admin"
|
href="/admin"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('nav.bookings')}
|
{t('nav.bookings')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/admin/products"
|
href="/admin/products"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('nav.products')}
|
{t('nav.products')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/admin/pickup-slots"
|
href="/admin/pickup-slots"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('nav.pickupSlots')}
|
{t('nav.pickupSlots')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/admin/replacements"
|
href="/admin/replacements"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{tr('navTitle')}
|
{tr('navTitle')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/admin/settings"
|
href="/admin/settings"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('nav.settings')}
|
{t('nav.settings')}
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href="/admin/users"
|
href="/admin/users"
|
||||||
className="rounded-md px-3 py-1.5 text-sm text-ink-600 hover:bg-ink-100"
|
className="rounded-md px-3 py-1.5 text-sm text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
>
|
>
|
||||||
{t('nav.users')}
|
{t('nav.users')}
|
||||||
</Link>
|
</Link>
|
||||||
@@ -82,7 +82,10 @@ export default async function AdminLayout({
|
|||||||
await signOut({ redirectTo: '/admin/login' });
|
await signOut({ redirectTo: '/admin/login' });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<button type="submit" className="btn-ghost text-xs">
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="rounded-md px-3 py-1.5 text-xs text-white/80 hover:bg-white/10 hover:text-white"
|
||||||
|
>
|
||||||
{t('nav.signOut')}
|
{t('nav.signOut')}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ export function BookingForm({
|
|||||||
/^\S+@\S+\.\S+$/.test(email) &&
|
/^\S+@\S+\.\S+$/.test(email) &&
|
||||||
phone.trim().length >= 5 &&
|
phone.trim().length >= 5 &&
|
||||||
orgName.trim().length >= 2 &&
|
orgName.trim().length >= 2 &&
|
||||||
isValidSeOrgNumber(orgNumber) &&
|
(orgNumber.trim() === '' || isValidSeOrgNumber(orgNumber)) &&
|
||||||
address.trim().length >= 2 &&
|
address.trim().length >= 2 &&
|
||||||
postalCode.trim().length >= 3 &&
|
postalCode.trim().length >= 3 &&
|
||||||
city.trim().length >= 1
|
city.trim().length >= 1
|
||||||
@@ -347,7 +347,6 @@ export function BookingForm({
|
|||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
label={t('details.orgNumber')}
|
label={t('details.orgNumber')}
|
||||||
required
|
|
||||||
value={orgNumber}
|
value={orgNumber}
|
||||||
onChange={(v) => patch({ orgNumber: v })}
|
onChange={(v) => patch({ orgNumber: v })}
|
||||||
placeholder={t('details.orgNumberPlaceholder')}
|
placeholder={t('details.orgNumberPlaceholder')}
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ export const bookingSubmitSchema = z.object({
|
|||||||
orgNumber: z
|
orgNumber: z
|
||||||
.string()
|
.string()
|
||||||
.trim()
|
.trim()
|
||||||
.min(10)
|
|
||||||
.max(13)
|
.max(13)
|
||||||
.refine((v) => isValidSeOrgNumber(v), {
|
.refine((v) => v === '' || isValidSeOrgNumber(v), {
|
||||||
message: 'invalidOrgNumber',
|
message: 'invalidOrgNumber',
|
||||||
})
|
})
|
||||||
.transform((v) => normalizeOrgNumber(v)),
|
.transform((v) => (v === '' ? null : normalizeOrgNumber(v)))
|
||||||
|
.nullable()
|
||||||
|
.optional(),
|
||||||
address: z.string().trim().min(2).max(200),
|
address: z.string().trim().min(2).max(200),
|
||||||
postalCode: z.string().trim().min(3).max(20),
|
postalCode: z.string().trim().min(3).max(20),
|
||||||
city: z.string().trim().min(1).max(100),
|
city: z.string().trim().min(1).max(100),
|
||||||
|
|||||||
Reference in New Issue
Block a user