func (VS *Server) newItem(c *gin.Context) {
	catID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	newItem, b := VS.getNewItem(c, bson.NewObjectId(), catID)
	if !b {
		return
	}
	if VS.addItemToDatabase(c, newItem, "h_data", "newItem", "v.addItemToDatabase") {
		VS.registerAddDatabaseMovementFromCentral(c, newItem, newItem.ID)
		VS.updateCategoryItems(c, catID, newItem)
		VS.goodFeedback(c, "/data/see-items/"+catID.Hex())
	} else {
		VS.wrongFeedback(c, "Sorry, there is already one Item with that name in the same category. Please choose another name or category")
	}
}
// Stores the new Item into the DataBase
Stores the new Item into the DataBase
// Stores the new Item into the DataBase
func (VS *Server) newItem(c *gin.Context) {
	catID, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	newItem, b := VS.getNewItem(c, bson.NewObjectId(), catID)
	if !b {
		return
	}
	if VS.addItemToDatabase(c, newItem, "h_data", "newItem", "v.addItemToDatabase") {
		VS.registerAddDatabaseMovementFromCentral(c, newItem, newItem.ID)
		VS.updateCategoryItems(c, catID, newItem)
		VS.goodFeedback(c, "/data/see-items/"+catID.Hex())
	} else {
		VS.wrongFeedback(c, "Sorry, there is already one Item with that name in the same category. Please choose another name or category")
	}
}
func ( VS * Server ) newItem ( c * gin . Context ) { catID , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } newItem , b := VS . getNewItem ( c , bson . NewObjectId ( ) , catID ) if ! b { return } if VS . addItemToDatabase ( c , newItem , " " , " " , " " ) { VS . registerAddDatabaseMovementFromCentral ( c , newItem , newItem . ID ) VS . updateCategoryItems ( c , catID , newItem ) VS . goodFeedback ( c , " " + catID . Hex ( ) ) } else { VS . wrongFeedback ( c , " " ) } }
Stores the new Item into the DataBase
Stores the new Item into the DataBase