🔧 feat(actions): Allow Multiple Actions from Same Domain per Assistant (#2120)

This commit is contained in:
Danny Avila 2024-03-16 19:40:51 -04:00 committed by GitHub
parent 89f6b35e6c
commit 7cddd943d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,14 +74,7 @@ router.post('/:assistant_id', async (req, res) => {
const { actions: _actions = [] } = assistant_data ?? {};
const actions = [];
for (const action of _actions) {
const [action_domain, current_action_id] = action.split(actionDelimiter);
if (action_domain === domain && !_action_id) {
// TODO: dupe check on the frontend
return res.status(400).json({
message: `Action sets cannot have duplicate domains - ${domain} already exists on another action`,
});
}
const [_action_domain, current_action_id] = action.split(actionDelimiter);
if (current_action_id === action_id) {
continue;
}