mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-14 03:41:51 +02:00
Create gists from git http server endpoint (#95)
This commit is contained in:
@ -104,6 +104,14 @@ func gistSoftInit(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// gistNewPushInit has the same behavior as gistSoftInit but create a new gist empty instead
|
||||
func gistNewPushSoftInit(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
setData(c, "gist", new(db.Gist))
|
||||
return next(c)
|
||||
}
|
||||
}
|
||||
|
||||
func allGists(ctx echo.Context) error {
|
||||
var err error
|
||||
var urlPage string
|
||||
@ -428,11 +436,6 @@ func toggleVisibility(ctx echo.Context) error {
|
||||
func deleteGist(ctx echo.Context) error {
|
||||
var gist = getData(ctx, "gist").(*db.Gist)
|
||||
|
||||
err := gist.DeleteRepository()
|
||||
if err != nil {
|
||||
return errorRes(500, "Error deleting the repository", err)
|
||||
}
|
||||
|
||||
if err := gist.Delete(); err != nil {
|
||||
return errorRes(500, "Error deleting this gist", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user