🗨️ feat: Prompt Slash Commands (#3219)

* chore: Update prompt description placeholder text

* fix: promptsPathPattern to not include new

* feat: command input and styling change for prompt views

* fix: intended validation

* feat: prompts slash command

* chore: localizations and fix add command during creation

* refactor(PromptsCommand): better label

* feat: update `allPrompGroups` cache on all promptGroups mutations

* refactor: ensure assistants builder is first within sidepanel

* refactor: allow defining emailVerified via create-user script
This commit is contained in:
Danny Avila 2024-06-27 17:34:48 -04:00 committed by GitHub
parent b8f2bee3fc
commit 83619de158
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 764 additions and 80 deletions

View file

@ -10,6 +10,7 @@ const {
updatePromptGroup,
deletePromptGroup,
createPromptGroup,
getAllPromptGroups,
// updatePromptLabels,
makePromptProduction,
} = require('~/models/Prompt');
@ -65,6 +66,22 @@ router.get('/groups/:groupId', async (req, res) => {
}
});
/**
* Route to fetch all prompt groups
* GET /groups
*/
router.get('/all', async (req, res) => {
try {
const groups = await getAllPromptGroups(req, {
author: req.user._id,
});
res.status(200).send(groups);
} catch (error) {
logger.error(error);
res.status(500).send({ error: 'Error getting prompt groups' });
}
});
/**
* Route to fetch paginated prompt groups with filters
* GET /groups