🔧 fix: Remove Unique Index from Actions Model and Initialize Empty Actions for Deletion (#2118)
This commit is contained in:
@@ -45,7 +45,6 @@ const actionSchema = new Schema({
|
||||
auth: AuthSchema,
|
||||
domain: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
},
|
||||
// json_schema: Schema.Types.Mixed,
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user