summaryrefslogtreecommitdiff
path: root/internal/api/client/notifications/notificationsget.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/notifications/notificationsget.go')
-rw-r--r--internal/api/client/notifications/notificationsget.go63
1 files changed, 32 insertions, 31 deletions
diff --git a/internal/api/client/notifications/notificationsget.go b/internal/api/client/notifications/notificationsget.go
index adfc1bcc3..6ce8adcab 100644
--- a/internal/api/client/notifications/notificationsget.go
+++ b/internal/api/client/notifications/notificationsget.go
@@ -50,6 +50,29 @@ import (
//
// parameters:
// -
+// name: max_id
+// type: string
+// description: >-
+// Return only notifications *OLDER* than the given max notification ID.
+// The notification with the specified ID will not be included in the response.
+// in: query
+// required: false
+// -
+// name: since_id
+// type: string
+// description: >-
+// Return only notifications *newer* than the given since notification ID.
+// The notification with the specified ID will not be included in the response.
+// in: query
+// -
+// name: min_id
+// type: string
+// description: >-
+// Return only notifications *immediately newer* than the given since notification ID.
+// The notification with the specified ID will not be included in the response.
+// in: query
+// required: false
+// -
// name: limit
// type: integer
// description: Number of notifications to return.
@@ -64,22 +87,6 @@ import (
// description: Array of types of notifications to exclude (follow, favourite, reblog, mention, poll, follow_request)
// in: query
// required: false
-// -
-// name: max_id
-// type: string
-// description: >-
-// Return only notifications *OLDER* than the given max status ID.
-// The status with the specified ID will not be included in the response.
-// in: query
-// required: false
-// -
-// name: since_id
-// type: string
-// description: |-
-// Return only notifications *NEWER* than the given since status ID.
-// The status with the specified ID will not be included in the response.
-// in: query
-// required: false
//
// security:
// - OAuth2 Bearer:
@@ -131,21 +138,15 @@ func (m *Module) NotificationsGETHandler(c *gin.Context) {
limit = int(i)
}
- maxID := ""
- maxIDString := c.Query(MaxIDKey)
- if maxIDString != "" {
- maxID = maxIDString
- }
-
- sinceID := ""
- sinceIDString := c.Query(SinceIDKey)
- if sinceIDString != "" {
- sinceID = sinceIDString
- }
-
- excludeTypes := c.QueryArray(ExcludeTypesKey)
-
- resp, errWithCode := m.processor.NotificationsGet(c.Request.Context(), authed, excludeTypes, limit, maxID, sinceID)
+ resp, errWithCode := m.processor.NotificationsGet(
+ c.Request.Context(),
+ authed,
+ c.Query(MaxIDKey),
+ c.Query(SinceIDKey),
+ c.Query(MinIDKey),
+ limit,
+ c.QueryArray(ExcludeTypesKey),
+ )
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return