This commit is contained in:
2023-05-14 07:57:23 +08:00
parent 5b8d0ca3c0
commit acb4839912
4 changed files with 7 additions and 9 deletions

View File

@@ -107,7 +107,7 @@ func SessionsItemGet(w http.ResponseWriter, r *http.Request) {
// 更新會話
func SessionsItemPatch(w http.ResponseWriter, r *http.Request) {
session := models.Session{ID: mux.Vars(r)["session_id"]}
if err := configs.ORMDB().Model(&session).Updates(GetForm(r)); err != nil {
if err := configs.ORMDB().Model(&session).Updates(GetForm(r)).Error; err != nil {
w.WriteHeader(http.StatusNotFound)
w.Write([]byte("404 - Not Found"))
return