[feature] Implement types[] param for notifications (#3009)

Counterpart of exclude_types[].

Also updates Swagger spec for types[] to use the correct param name and enumerate possible values.

Fixes #3003
This commit is contained in:
Vyr Cossont
2024-06-17 12:50:50 -07:00
committed by GitHub
parent 7ab404d643
commit b08c1bd0cb
10 changed files with 459 additions and 13 deletions

View File

@@ -80,11 +80,37 @@ import (
// in: query
// required: false
// -
// name: exclude_types
// name: types[]
// type: array
// items:
// type: string
// description: Array of types of notifications to exclude (follow, favourite, reblog, mention, poll, follow_request)
// enum:
// - follow
// - follow_request
// - mention
// - reblog
// - favourite
// - poll
// - status
// - admin.sign_up
// description: Types of notifications to include. If not provided, all notification types will be included.
// in: query
// required: false
// -
// name: exclude_types[]
// type: array
// items:
// type: string
// enum:
// - follow
// - follow_request
// - mention
// - reblog
// - favourite
// - poll
// - status
// - admin.sign_up
// description: Types of notifications to exclude.
// in: query
// required: false
//
@@ -145,6 +171,7 @@ func (m *Module) NotificationsGETHandler(c *gin.Context) {
c.Query(SinceIDKey),
c.Query(MinIDKey),
limit,
c.QueryArray(IncludeTypesKey),
c.QueryArray(ExcludeTypesKey),
)
if errWithCode != nil {