func (VS *Server) editVillage(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldVillage := VS.getVillageByID(c, id, "h_data", "editVillage", "oldVillage := VS.getVillageByID")
	newVillage, b := VS.getNewVillage(c, id, oldVillage.Prefix)
	if !b {
		return
	}

	// Here we save the changes
	audit := VS.getAuditFromCentral(c, newVillage, id, Modified)
	modified := VS.dynamicAuditChange(c, newVillage, oldVillage, audit.ID)
	if modified {
		if VS.addVillageToDatabase(c, newVillage, "h_data", "editVillage", "VS.addVillageToDatabase") {
			VS.registerAuditAndEvent(c, audit, newVillage, newVillage.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Village with that Name or Prefix. Please choose another name ")
		}
		VS.goodFeedback(c, "/data/villages")
	}
}
// Modifies Village information into the DataBase
Modifies Village information into the DataBase
// Modifies Village information into the DataBase
func (VS *Server) editVillage(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldVillage := VS.getVillageByID(c, id, "h_data", "editVillage", "oldVillage := VS.getVillageByID")
	newVillage, b := VS.getNewVillage(c, id, oldVillage.Prefix)
	if !b {
		return
	}
	audit := VS.getAuditFromCentral(c, newVillage, id, Modified)
	modified := VS.dynamicAuditChange(c, newVillage, oldVillage, audit.ID)
	if modified {
		if VS.addVillageToDatabase(c, newVillage, "h_data", "editVillage", "VS.addVillageToDatabase") {
			VS.registerAuditAndEvent(c, audit, newVillage, newVillage.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Village with that Name or Prefix. Please choose another name ")
		}
		VS.goodFeedback(c, "/data/villages")
	}
}
func ( VS * Server ) editVillage ( c * gin . Context ) { id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } oldVillage := VS . getVillageByID ( c , id , " " , " " , " " ) newVillage , b := VS . getNewVillage ( c , id , oldVillage . Prefix ) if ! b { return } audit := VS . getAuditFromCentral ( c , newVillage , id , Modified ) modified := VS . dynamicAuditChange ( c , newVillage , oldVillage , audit . ID ) if modified { if VS . addVillageToDatabase ( c , newVillage , " " , " " , " " ) { VS . registerAuditAndEvent ( c , audit , newVillage , newVillage . ID ) } else { VS . wrongFeedback ( c , " " ) } VS . goodFeedback ( c , " " ) } }
Modifies Village information into the DataBase
Modifies Village information into the DataBase
// Here we save the changes