apps.openapi(routeGetApp, async (c) => {
~~~~~~~~~~~~~~
try {
const { identifier } = c.req.valid('param');
const result = await db.query.app.findFirst({
where: eq(app.name, identifier),
with: { feature: true },
});
if (!result) return c.notFound();
console.log(result);
return c.json({
id: result.id,
identifier: result.name,
features: {
featureX: result.feature.deleteMessage,
featureY: result.feature.inviteLinks,
},
});
} catch (error) { return c.json(error, 500); }
});
apps.openapi(routeGetApp, async (c) => {
~~~~~~~~~~~~~~
try {
const { identifier } = c.req.valid('param');
const result = await db.query.app.findFirst({
where: eq(app.name, identifier),
with: { feature: true },
});
if (!result) return c.notFound();
console.log(result);
return c.json({
id: result.id,
identifier: result.name,
features: {
featureX: result.feature.deleteMessage,
featureY: result.feature.inviteLinks,
},
});
} catch (error) { return c.json(error, 500); }
});