mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50: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 { promptId } = req.params;
|
||||||
const { groupId } = req.query;
|
const { groupId } = req.query;
|
||||||
const author = req.user.id;
|
const author = req.user.id;
|
||||||
const query = { promptId, groupId, author };
|
const query = { promptId, groupId, author, role: req.user.role };
|
||||||
if (req.user.role === SystemRoles.ADMIN) {
|
|
||||||
delete query.author;
|
|
||||||
}
|
|
||||||
const result = await deletePrompt(query);
|
const result = await deletePrompt(query);
|
||||||
res.status(200).send(result);
|
res.status(200).send(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue