Skip to content

Commit c34f0ca

Browse files
authored
fix(memory): DeleteVariableInstance fails when connectId is 0 (#1874)
1 parent e5db24f commit c34f0ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/application/memory/variables.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,13 @@ func (v *VariableApplicationService) DeleteVariableInstance(ctx context.Context,
291291

292292
bizType := ternary.IFElse(req.BotID == 0, project_memory.VariableConnector_Project, project_memory.VariableConnector_Bot)
293293
bizID := ternary.IFElse(req.BotID == 0, req.ProjectID, fmt.Sprintf("%d", req.BotID))
294+
connectId := ternary.IFElse(req.ConnectorID == nil, consts.CozeConnectorID, req.GetConnectorID())
294295

295296
e := entity.NewUserVariableMeta(&model.UserVariableMeta{
296297
BizType: bizType,
297298
BizID: bizID,
298299
Version: "",
299-
ConnectorID: req.GetConnectorID(),
300+
ConnectorID: connectId,
300301
ConnectorUID: fmt.Sprintf("%d", *uid),
301302
})
302303

0 commit comments

Comments
 (0)