fix: agents query

This commit is contained in:
Danny Avila 2024-09-03 18:49:15 -04:00
parent 3f694f2e25
commit dd90907a18
No known key found for this signature in database
GPG key ID: 2DD9CC89B9B50364
2 changed files with 9 additions and 10 deletions

View file

@ -131,9 +131,9 @@ const deleteAgentHandler = async (req, res) => {
*/
const getListAgentsHandler = async (req, res) => {
try {
const { user } = req.query;
const filter = user ? { author: user } : {};
const data = await getListAgents(filter);
const data = await getListAgents({
author: req.user.id,
});
return res.json(data);
} catch (error) {
logger.error('[/Agents] Error listing Agents', error);