fix: Fix the problem of failed quick command editing (#8650)

refs #8641
This commit is contained in:
ssongliu 2025-05-14 22:38:34 +08:00 committed by GitHub
parent d6723e20b8
commit 41b9087110
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -22,6 +22,7 @@ type CommandInfo struct {
ID uint `json:"id"`
GroupID uint `json:"groupID"`
Name string `json:"name"`
Type string `json:"type"`
Command string `json:"command"`
GroupBelong string `json:"groupBelong"`
}

View file

@ -125,7 +125,7 @@ func (u *CommandService) Delete(ids []uint) error {
func (u *CommandService) Update(req dto.CommandOperate) error {
command, _ := commandRepo.Get(repo.WithByName(req.Name), repo.WithByType(req.Type))
if command.ID != req.ID {
if command.ID != 0 && command.ID != req.ID {
return buserr.New("ErrRecordExist")
}
upMap := make(map[string]interface{})