adding stuff
This commit is contained in:
@@ -116,6 +116,21 @@ export default async function recommendationsRoute(fastify: FastifyInstance) {
|
||||
}
|
||||
});
|
||||
|
||||
// DELETE /recommendations/:id — delete a recommendation
|
||||
fastify.delete('/recommendations/:id', async (request, reply) => {
|
||||
const { id } = request.params as { id: string };
|
||||
const [rec] = await db
|
||||
.select({ id: recommendations.id })
|
||||
.from(recommendations)
|
||||
.where(eq(recommendations.id, id));
|
||||
|
||||
if (!rec) return reply.code(404).send({ error: 'Not found' });
|
||||
|
||||
await db.delete(recommendations).where(eq(recommendations.id, id));
|
||||
|
||||
return reply.send({ ok: true });
|
||||
});
|
||||
|
||||
// POST /recommendations/:id/rerank — reset status so client can re-open SSE stream
|
||||
fastify.post('/recommendations/:id/rerank', async (request, reply) => {
|
||||
const { id } = request.params as { id: string };
|
||||
|
||||
Reference in New Issue
Block a user