view route updates

This commit is contained in:
2025-05-26 16:00:05 +05:30
parent b51e36ebad
commit ffef6fe644
5 changed files with 35 additions and 26 deletions

View File

@@ -93,8 +93,9 @@ export async function getDefaultViewsHanlder(
req: FastifyRequest,
res: FastifyReply
) {
const { collection } = req.params as { collection: string };
try {
const recInDb = await getDefaultViews(req.user);
const recInDb = await getDefaultViews(collection, req.user);
return res.code(200).send(recInDb);
} catch (err) {
return err;
@@ -109,7 +110,7 @@ export async function updateDefaultViewsHanlder(
try {
const recInDb = await updateDefaultView(input, req.user);
return res.code(200).send({ ...recInDb.defaultViews });
return res.code(200).send(recInDb?.defaultViews);
} catch (err) {
return err;
}