Add custom urls for gists (#183)

This commit is contained in:
Thomas Miceli
2023-12-26 03:24:04 +01:00
parent 85e2da054b
commit 3828022a1c
16 changed files with 173 additions and 67 deletions

View File

@ -398,7 +398,7 @@ func writePermission(next echo.HandlerFunc) echo.HandlerFunc {
gist := getData(ctx, "gist")
user := getUserLogged(ctx)
if !gist.(*db.Gist).CanWrite(user) {
return redirect(ctx, "/"+gist.(*db.Gist).User.Username+"/"+gist.(*db.Gist).Uuid)
return redirect(ctx, "/"+gist.(*db.Gist).User.Username+"/"+gist.(*db.Gist).Identifier())
}
return next(ctx)
}