fix: event type validations skip
parent
d991c68b08
commit
1717f14e83
|
@ -153,10 +153,10 @@ interface EventTypeExtended extends Omit<EventType, "recurringEvent" | "location
|
|||
|
||||
// EventType
|
||||
export type EventTypeResponse = BaseResponse & {
|
||||
event_type?: Partial<EventTypeExtended>;
|
||||
event_type?: Partial<EventType | EventTypeExtended>;
|
||||
};
|
||||
export type EventTypesResponse = BaseResponse & {
|
||||
event_types?: Partial<EventTypeExtended>[];
|
||||
event_types?: Partial<EventType | EventTypeExtended>[];
|
||||
};
|
||||
|
||||
// Payment
|
||||
|
|
|
@ -30,8 +30,10 @@ async function createOrlistAllEventTypes(
|
|||
* description: No event types were found
|
||||
*/
|
||||
const data = await prisma.eventType.findMany({ where: { userId } });
|
||||
const event_types = data.map((eventType) => schemaEventTypeReadPublic.parse(eventType));
|
||||
if (event_types) res.status(200).json({ event_types });
|
||||
// const event_types = data.map(
|
||||
// async (eventType) => await schemaEventTypeReadPublic.safeParseAsync(eventType)
|
||||
// );
|
||||
if (data) res.status(200).json({ event_types: data });
|
||||
else
|
||||
(error: Error) =>
|
||||
res.status(404).json({
|
||||
|
|
Loading…
Reference in New Issue