debug
This commit is contained in:
		@@ -105,8 +105,9 @@ func ModelItemGet(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
 | 
			
		||||
func ModelItemPatch(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	var model = models.Model{ID: utils.ParamInt(mux.Vars(r)["id"], 0)}
 | 
			
		||||
	if err := configs.ORMDB().Take(&model, utils.ParamInt(mux.Vars(r)["id"], 0)); err != nil {
 | 
			
		||||
	if err := configs.ORMDB().Take(&model, utils.ParamInt(mux.Vars(r)["id"], 0)).Error; err != nil {
 | 
			
		||||
		w.WriteHeader(http.StatusNotFound)
 | 
			
		||||
		w.Write([]byte(err.Error()))
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -133,9 +134,9 @@ func ModelItemPatch(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	if model_new.Status != "" && model_new.Status != model.Status {
 | 
			
		||||
		model.Status = model_new.Status
 | 
			
		||||
		// 如果狀態被改變爲 ready, 將模型發送到訓練隊列
 | 
			
		||||
		if model.Status == "ready" {
 | 
			
		||||
			//model.SendToTrain()
 | 
			
		||||
		}
 | 
			
		||||
		//if model.Status == "ready" {
 | 
			
		||||
		//	model.SendToTrain()
 | 
			
		||||
		//}
 | 
			
		||||
	}
 | 
			
		||||
	if model_new.Image != "" && model_new.Image != model.Image {
 | 
			
		||||
		model.Image = model_new.Image
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user