package main import ( "biukop.com/sfm/loan" log "github.com/sirupsen/logrus" "net/http" ) func apiV1SyncPeople(w http.ResponseWriter, r *http.Request, ss *loan.Session) { input, e := decodeJsonLoanEdit(r) log.Println(input) if e != nil { apiV1Client404Error(w, r, ss) return } else { e = input.ClearPeopleMap() if e != nil { log.Error("FATAL ERROR for deleting people map with LoanId=", input.Id) } for _, v := range input.PeopleMap { e = v.Write() if e != nil { apiV1Client404Error(w, r, ss) return } } // all successfully written to db apiV1SendJson(input.PeopleMap, w, r, ss) } return }