Ejemplo n.º 1
0
func EditTeacherInfoByAdmin(w http.ResponseWriter, r *http.Request, userId string, userType models.UserType) interface{} {
	teacherUsername := r.PostFormValue("teacher_username")
	fullname := r.PostFormValue("fullname")
	gender := r.PostFormValue("gender")
	major := r.PostFormValue("major")
	academic := r.PostFormValue("academic")
	aptitude := r.PostFormValue("aptitude")
	problem := r.PostFormValue("problem")

	var result = map[string]interface{}{"state": "SUCCESS"}
	var al = buslogic.AdminLogic{}

	_, err := al.EditTeacherInfoByAdmin(teacherUsername, fullname, gender, major, academic, aptitude, problem, userId, userType)
	if err != nil {
		ErrorHandler(w, r, err)
		return nil
	}

	return result
}