diff --git a/internal/db/helpers.go b/internal/db/helpers.go index 221bfc9..544e6f6 100644 --- a/internal/db/helpers.go +++ b/internal/db/helpers.go @@ -24,14 +24,6 @@ func (r GetUserWatchListRow) DisplayTitle() string { return DisplayTitle(r.TitleEnglish, r.TitleJapanese, r.TitleOriginal) } -// BoolPtr converts a nullable bool to a pointer; nil if not valid -func BoolPtr(b sql.NullBool) *bool { - if !b.Valid { - return nil - } - return &b.Bool -} - // BeginTx starts a transaction and returns the Queries wrapper bound to it func BeginTx(ctx context.Context, db *sql.DB) (*Queries, *sql.Tx, error) { if db == nil { diff --git a/pkg/middleware/ratelimit.go b/pkg/middleware/ratelimit.go index a624d37..ce419d5 100644 --- a/pkg/middleware/ratelimit.go +++ b/pkg/middleware/ratelimit.go @@ -61,17 +61,6 @@ func getIP(r *http.Request) string { return ip } -// Middleware returns 429 for rate-limited API requests -func (l *Limiter) Middleware(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if !l.allow(getIP(r)) { - http.Error(w, "Too many requests. Please try again later.", http.StatusTooManyRequests) - return - } - next.ServeHTTP(w, r) - }) -} - // AuthMiddleware redirects rate-limited form submissions back to the page // returns 429 for non-path requests (e.g. API calls) func (l *Limiter) AuthMiddleware(next http.Handler) http.Handler { diff --git a/templates/base.gohtml b/templates/base.gohtml index 9fdd35c..bbc9f42 100644 --- a/templates/base.gohtml +++ b/templates/base.gohtml @@ -205,7 +205,7 @@ if (window.showToast) showToast({ message: 'Something went wrong' })
{{template "header" .}}
-
+
{{template "content" .}}
{{template "footer" .}}