MED-103: add booking functionality
This commit is contained in:
11
lib/utils.ts
11
lib/utils.ts
@@ -20,7 +20,7 @@ export function toTitleCase(str?: string) {
|
||||
?.toLowerCase()
|
||||
.replace(/[^-'’\s]+/g, (match) =>
|
||||
match.replace(/^./, (first) => first.toUpperCase()),
|
||||
) ?? ""
|
||||
) ?? ''
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,6 +145,13 @@ export default class PersonalCode {
|
||||
gender,
|
||||
dob: parsed.getBirthday(),
|
||||
age: parsed.getAge(),
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const findProductTypeIdByHandle = (
|
||||
productTypes: { metadata?: Record<string, unknown> | null; id: string }[],
|
||||
handle: string,
|
||||
) => {
|
||||
return productTypes.find(({ metadata }) => metadata?.handle === handle)?.id;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user