Пример #1
0
// RepoDelete removes a specific repo.
func RepoDelete(c *gin.Context) {
	record := session.Repo(c)

	err := store.DeleteRepo(
		c,
		record,
	)

	if err != nil {
		logrus.Warnf("Failed to delete repo. %s", err)

		c.JSON(
			http.StatusBadRequest,
			gin.H{
				"status":  http.StatusBadRequest,
				"message": "Failed to delete repo",
			},
		)

		c.Abort()
		return
	}

	c.JSON(
		http.StatusOK,
		gin.H{
			"status":  http.StatusOK,
			"message": "Successfully deleted repo",
		},
	)
}
Пример #2
0
// RepoShow retrieves a specific repo.
func RepoShow(c *gin.Context) {
	record := session.Repo(c)

	c.JSON(
		http.StatusOK,
		record,
	)
}