diff options
author | 2024-06-17 12:50:50 -0700 | |
---|---|---|
committer | 2024-06-17 20:50:50 +0100 | |
commit | b08c1bd0cbf6986e59247deefbabb150db83aadd (patch) | |
tree | 45d47345c2cf46ddf50533be16470edd17a1da2a /internal/api/client/notifications/notificationsget.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#3016) (diff) | |
download | gotosocial-b08c1bd0cbf6986e59247deefbabb150db83aadd.tar.xz |
[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
Diffstat (limited to 'internal/api/client/notifications/notificationsget.go')
-rw-r--r-- | internal/api/client/notifications/notificationsget.go | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/internal/api/client/notifications/notificationsget.go b/internal/api/client/notifications/notificationsget.go index da43cffec..533932d11 100644 --- a/internal/api/client/notifications/notificationsget.go +++ b/internal/api/client/notifications/notificationsget.go @@ -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 { |