fix: add special requests to store

This commit is contained in:
Christel Westerberg
2024-12-11 15:19:43 +01:00
parent ed3879f6d2
commit 4872847ecb
10 changed files with 26 additions and 30 deletions

View File

@@ -53,9 +53,17 @@ export default function Details({ user, memberPrice }: DetailsProps) {
membershipNo: initialData.membershipNo,
phoneNumber: user?.phoneNumber ?? initialData.phoneNumber,
zipCode: initialData.zipCode,
specialRequests: initialData.specialRequests,
},
})
const noPreferenceItem = {
value: "",
label: intl.formatMessage({
id: "No preference",
}),
}
const onSubmit = useCallback(
(values: DetailsSchema) => {
updateDetails(values)
@@ -135,12 +143,7 @@ export default function Details({ user, memberPrice }: DetailsProps) {
label={intl.formatMessage({ id: "Floor preference" })}
name="specialRequests.floorPreference"
items={[
{
value: "",
label: intl.formatMessage({
id: "No preference",
}),
},
noPreferenceItem,
{
value: FloorPreference.HIGH,
label: intl.formatMessage({ id: FloorPreference.HIGH }),
@@ -156,12 +159,7 @@ export default function Details({ user, memberPrice }: DetailsProps) {
label={intl.formatMessage({ id: "Elevator preference" })}
name="specialRequests.elevatorPreference"
items={[
{
value: "",
label: intl.formatMessage({
id: "No preference",
}),
},
noPreferenceItem,
{
value: ElevatorPreference.AWAY_FROM_ELEVATOR,
label: intl.formatMessage({

View File

@@ -22,7 +22,7 @@ const specialRequestsSchema = z
.object({
floorPreference: z.nativeEnum(FloorPreference).optional(),
elevatorPreference: z.nativeEnum(ElevatorPreference).optional(),
comments: z.string().optional(),
comments: z.string().default(""),
})
.optional()

View File

@@ -118,7 +118,7 @@
.accordion:not(:last-child) .iconWrapper::after {
position: absolute;
left: 12px;
bottom: calc(0px - var(--Spacing-x7));
bottom: calc(0px - var(--Spacing-x5));
top: var(--circle-height);
content: "";