mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
feat: first pass, sharing agents
This commit is contained in:
parent
0a73caf1d8
commit
1bc0689134
8 changed files with 241 additions and 22 deletions
|
|
@ -101,10 +101,13 @@ const updateAgentHandler = async (req, res) => {
|
|||
const id = req.params.id;
|
||||
const { projectIds, removeProjectIds, ...updateData } = req.body;
|
||||
|
||||
const updatedAgent = await updateAgent({ id, author: req.user.id }, updateData);
|
||||
let updatedAgent;
|
||||
if (Object.keys(updateData).length > 0) {
|
||||
updatedAgent = await updateAgent({ id, author: req.user.id }, updateData);
|
||||
}
|
||||
|
||||
if (projectIds || removeProjectIds) {
|
||||
await updateAgentProjects(id, projectIds, removeProjectIds);
|
||||
updatedAgent = await updateAgentProjects(id, projectIds, removeProjectIds);
|
||||
}
|
||||
|
||||
return res.json(updatedAgent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue