fix: dont validate read event-type
parent
35ebf53f19
commit
eb03188d78
|
@ -55,7 +55,7 @@ export async function eventTypeById(
|
||||||
case "GET":
|
case "GET":
|
||||||
await prisma.eventType
|
await prisma.eventType
|
||||||
.findUnique({ where: { id: safeQuery.data.id } })
|
.findUnique({ where: { id: safeQuery.data.id } })
|
||||||
.then((data) => schemaEventTypeReadPublic.parse(data))
|
// .then((data) => schemaEventTypeReadPublic.parse(data))
|
||||||
.then((event_type) => res.status(200).json({ event_type }))
|
.then((event_type) => res.status(200).json({ event_type }))
|
||||||
.catch((error: Error) =>
|
.catch((error: Error) =>
|
||||||
res.status(404).json({
|
res.status(404).json({
|
||||||
|
|
|
@ -30,8 +30,8 @@ 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((eventType) => schemaEventTypeReadPublic.parse(eventType));
|
||||||
if (event_types) res.status(200).json({ event_types });
|
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