fix: add special requests to store
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user