Пример #1
0
func (t *TypesController) UpdateTypeItemById(c *gin.Context) {
	//appId := c.Param("appId")
	//typeName := c.Param("typeName")
	itemId := c.Param("itemId")
	//TODO: same as get
	body := webUtils.GetBody(c)
	err := t.DbService.UpdateItemById(itemId, body)
	if err != nil {
		log.Error(RestError(c, err))
		return
	}
}
Пример #2
0
func (t *TypesController) InsertInTypeHandler(c *gin.Context) {
	appId := c.Param("appId")
	typeName := c.Param("typeName")
	body := webUtils.GetBody(c)

	id, err := t.DbService.CreateItem(appId, typeName, body)
	if err != nil {
		log.Error(RestError(c, err))
		return
	}

	RespondId(id, c)
}