🔧 fix: Remove Unique Index from Actions Model and Initialize Empty Actions for Deletion (#2118)

This commit is contained in:
Danny Avila 2024-03-16 18:53:43 -04:00 committed by GitHub
parent a8cdd3460c
commit 89f6b35e6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View file

@ -45,7 +45,6 @@ const actionSchema = new Schema({
auth: AuthSchema,
domain: {
type: String,
unique: true,
required: true,
},
// json_schema: Schema.Types.Mixed,

View file

@ -162,7 +162,7 @@ router.delete('/:assistant_id/:action_id', async (req, res) => {
/** @type {[AssistantDocument, Assistant]} */
const [assistant_data, assistant] = await Promise.all(initialPromises);
const { actions } = assistant_data ?? {};
const { actions = [] } = assistant_data ?? {};
const { tools = [] } = assistant ?? {};
let domain = '';