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