mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 14:57:50 +01:00
Backport #25548 by @Zettat123 This PR - fixes #25545 - fixes two incorrect `reqToken()` in `/notifications` endpoints (caused by #24767) Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
parent
7222bac4e3
commit
77db40e084
@ -783,11 +783,11 @@ func Routes(ctx gocontext.Context) *web.Route {
|
||||
m.Group("/notifications", func() {
|
||||
m.Combo("").
|
||||
Get(notify.ListNotifications).
|
||||
Put(notify.ReadNotifications, reqToken())
|
||||
Put(reqToken(), notify.ReadNotifications)
|
||||
m.Get("/new", notify.NewAvailable)
|
||||
m.Combo("/threads/{id}").
|
||||
Get(notify.GetThread).
|
||||
Patch(notify.ReadThread, reqToken())
|
||||
Patch(reqToken(), notify.ReadThread)
|
||||
}, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryNotification))
|
||||
|
||||
// Users (requires user scope)
|
||||
|
@ -183,7 +183,7 @@ func ReadRepoNotifications(ctx *context.APIContext) {
|
||||
if len(qLastRead) > 0 {
|
||||
tmpLastRead, err := time.Parse(time.RFC3339, qLastRead)
|
||||
if err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
ctx.Error(http.StatusBadRequest, "Parse", err)
|
||||
return
|
||||
}
|
||||
if !tmpLastRead.IsZero() {
|
||||
|
@ -132,7 +132,7 @@ func ReadNotifications(ctx *context.APIContext) {
|
||||
if len(qLastRead) > 0 {
|
||||
tmpLastRead, err := time.Parse(time.RFC3339, qLastRead)
|
||||
if err != nil {
|
||||
ctx.InternalServerError(err)
|
||||
ctx.Error(http.StatusBadRequest, "Parse", err)
|
||||
return
|
||||
}
|
||||
if !tmpLastRead.IsZero() {
|
||||
|
Loading…
Reference in New Issue
Block a user