func GetList(c *gin.Context) {
	db := utils.GetDb(c)
	query := BuildQuery(c)
	err, subs := subdb.GetList(db, query)
	if err != nil {
		c.Error(err)
		return
	}
	c.JSON(http.StatusOK, subs)
}
Exemple #2
0
func GetVacancySubscriptions(c *gin.Context) {
	db := utils.GetDb(c)
	id := c.Params.ByName("id")

	query := map[string]interface{}{}
	query["vacancy"] = id
	//query["vacancy"]

	err, subs := subdb.GetList(db, query)
	if err != nil {
		c.Error(err)
		return
	}

	c.JSON(http.StatusOK, subs)
}