mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🐛 fix: Update deletePromptController to include user role in query (#5488)
This commit is contained in:
parent
8b31f255f5
commit
12a9a07eb0
1 changed files with 1 additions and 4 deletions
|
|
@ -214,10 +214,7 @@ const deletePromptController = async (req, res) => {
|
|||
const { promptId } = req.params;
|
||||
const { groupId } = req.query;
|
||||
const author = req.user.id;
|
||||
const query = { promptId, groupId, author };
|
||||
if (req.user.role === SystemRoles.ADMIN) {
|
||||
delete query.author;
|
||||
}
|
||||
const query = { promptId, groupId, author, role: req.user.role };
|
||||
const result = await deletePrompt(query);
|
||||
res.status(200).send(result);
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue