Просмотр исходного кода

Fix bugs related to notification endpoints (#25548)

tags/v1.21.0-rc0
Zettat123 11 месяцев назад
Родитель
Сommit
defd807073
Аккаунт пользователя с таким Email не найден
3 измененных файлов: 4 добавлений и 4 удалений
  1. 2
    2
      routers/api/v1/api.go
  2. 1
    1
      routers/api/v1/notify/repo.go
  3. 1
    1
      routers/api/v1/notify/user.go

+ 2
- 2
routers/api/v1/api.go Просмотреть файл

@@ -777,11 +777,11 @@ func Routes() *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)

+ 1
- 1
routers/api/v1/notify/repo.go Просмотреть файл

@@ -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() {

+ 1
- 1
routers/api/v1/notify/user.go Просмотреть файл

@@ -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() {

Загрузка…
Отмена
Сохранить