Add 2 new admin actions (#191)

* Synchronize all gists previews
* Reset Git server hooks for all repositories
This commit is contained in:
Thomas Miceli
2024-01-02 04:01:45 +01:00
parent 97707f7cca
commit f52310a841
10 changed files with 213 additions and 86 deletions

View File

@ -542,7 +542,7 @@ func toggleVisibility(ctx echo.Context) error {
gist := getData(ctx, "gist").(*db.Gist)
gist.Private = (gist.Private + 1) % 3
if err := gist.Update(); err != nil {
if err := gist.UpdateNoTimestamps(); err != nil {
return errorRes(500, "Error updating this gist", err)
}
@ -806,7 +806,7 @@ func checkbox(ctx echo.Context) error {
return errorRes(500, "Error adding and committing files", err)
}
if err = gist.UpdatePreviewAndCount(); err != nil {
if err = gist.UpdatePreviewAndCount(true); err != nil {
return errorRes(500, "Error updating the gist", err)
}