Esempio n. 1
0
func addNewProject(c *gin.Context) {
	nwo := strings.TrimSpace(c.PostForm("repo"))
	if nwo == "" {
		render.New(c).HTML(http.StatusOK, "add.tmpl", add{fmt.Errorf("the repository name cannot be empty")})
		return
	}

	if err := github.AddProject(nwo); err != nil {
		render.New(c).HTML(http.StatusOK, "add.tmpl", add{err})
		return
	}

	showProjects(c)
}
Esempio n. 2
0
func addProject(nwo string) error {
	return github.AddProject(nwo)
}