mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-09 11:55:52 +08:00
fix: Fix the problem of failed quick command editing (#8650)
refs #8641
This commit is contained in:
parent
d6723e20b8
commit
41b9087110
2 changed files with 2 additions and 1 deletions
|
|
@ -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"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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{})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue