fix node role save

This commit is contained in:
710leo 2020-12-17 20:26:13 +08:00
parent d6d2e32b2e
commit 8bba55e441
1 changed files with 1 additions and 3 deletions

View File

@ -1,7 +1,5 @@
package models
import "fmt"
type NodeRole struct {
Id int64 `json:"id"`
NodeId int64 `json:"node_id"`
@ -18,7 +16,7 @@ func (nr *NodeRole) Save() error {
}
if cnt > 0 {
return fmt.Errorf("user already has this role")
return nil
}
_, err = DB["rdb"].Insert(nr)