func (VS *Server) editType(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldCategoryType := VS.getCategoryTypeByID(c, id, "h_data", "editType", "oldCategoryType := VS.getCategoryTypeByID")
	newCategoryType, b := VS.getNewCategoryType(c, id)
	if !b {
		return
	}
	audit := VS.getAuditFromCentral(c, newCategoryType, id, Modified)
	modified := VS.checkChange(c, audit.ID, "Name", oldCategoryType.Name, newCategoryType.Name)
	if modified {
		// If we changed the name, we move the images of folder
		VS.move(basePath+"/local-resources/categories/"+oldCategoryType.Name+"/", basePath+"/local-resources/categories/"+newCategoryType.Name+"/")
		if VS.addCategoryTypeToDatabase(c, newCategoryType, "h_data", "editType", "VS.addCategoryTypeToDatabase") {
			VS.registerAuditAndEvent(c, audit, newCategoryType, newCategoryType.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Category Type with that name. Please choose another name ")
		}
	}
	VS.goodFeedback(c, "/data/categories")
}
// Modifies the Category Type information into the DataBase
Modifies the Category Type information into the DataBase
// Modifies the Category Type information into the DataBase
func (VS *Server) editType(c *gin.Context) {
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	oldCategoryType := VS.getCategoryTypeByID(c, id, "h_data", "editType", "oldCategoryType := VS.getCategoryTypeByID")
	newCategoryType, b := VS.getNewCategoryType(c, id)
	if !b {
		return
	}
	audit := VS.getAuditFromCentral(c, newCategoryType, id, Modified)
	modified := VS.checkChange(c, audit.ID, "Name", oldCategoryType.Name, newCategoryType.Name)
	if modified {
		VS.move(basePath+"/local-resources/categories/"+oldCategoryType.Name+"/", basePath+"/local-resources/categories/"+newCategoryType.Name+"/")
		if VS.addCategoryTypeToDatabase(c, newCategoryType, "h_data", "editType", "VS.addCategoryTypeToDatabase") {
			VS.registerAuditAndEvent(c, audit, newCategoryType, newCategoryType.ID)
		} else {
			VS.wrongFeedback(c, "Sorry, there is already one Category Type with that name. Please choose another name ")
		}
	}
	VS.goodFeedback(c, "/data/categories")
}
func ( VS * Server ) editType ( c * gin . Context ) { id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } oldCategoryType := VS . getCategoryTypeByID ( c , id , " " , " " , " " ) newCategoryType , b := VS . getNewCategoryType ( c , id ) if ! b { return } audit := VS . getAuditFromCentral ( c , newCategoryType , id , Modified ) modified := VS . checkChange ( c , audit . ID , " " , oldCategoryType . Name , newCategoryType . Name ) if modified { VS . move ( basePath + " " + oldCategoryType . Name + " " , basePath + " " + newCategoryType . Name + " " ) if VS . addCategoryTypeToDatabase ( c , newCategoryType , " " , " " , " " ) { VS . registerAuditAndEvent ( c , audit , newCategoryType , newCategoryType . ID ) } else { VS . wrongFeedback ( c , " " ) } } VS . goodFeedback ( c , " " ) }
Modifies the Category Type information into the DataBase
Modifies the Category Type information into the DataBase
// If we changed the name, we move the images of folder