mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
fix: maybe fail to sync config to remote node #775
This commit is contained in:
parent
a691532db2
commit
3fecf9eb20
1 changed files with 4 additions and 1 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
"github.com/sashabaranov/go-openai"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"gorm.io/gen/field"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -55,7 +56,9 @@ func EditConfig(c *gin.Context) {
|
|||
}
|
||||
|
||||
q := query.Config
|
||||
cfg, err := q.Where(q.Filepath.Eq(absPath)).FirstOrCreate()
|
||||
cfg, err := q.Assign(field.Attrs(&model.Config{
|
||||
Name: filepath.Base(absPath),
|
||||
})).Where(q.Filepath.Eq(absPath)).FirstOrCreate()
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue