* update to show exact err msg with custom event name * updated tests for validateCustomEventName --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
5 files changed
+24
-22
No files matched your search
@@ -100,11 +100,7 @@ export function getEventName(eventNameObj: EventNameObjectType, forAttendeeView
|
||||
return dynamicEventName;
|
||||
}
|
||||
|
||||
export const validateCustomEventName = (
|
||||
value: string,
|
||||
message: string,
|
||||
bookingFields?: Prisma.JsonObject
|
||||
) => {
|
||||
export const validateCustomEventName = (value: string, bookingFields?: Prisma.JsonObject) => {
|
||||
let customInputVariables: string[] = [];
|
||||
if (bookingFields) {
|
||||
customInputVariables = Object.keys(bookingFields).map((customInput) => {
|
||||
@@ -131,7 +127,7 @@ export const validateCustomEventName = (
|
||||
if (matches?.length) {
|
||||
for (const item of matches) {
|
||||
if (!validVariables.includes(item)) {
|
||||
return message;
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user