diff --git a/coderd/inboxnotifications.go b/coderd/inboxnotifications.go index 9682966fe8..96976cf649 100644 --- a/coderd/inboxnotifications.go +++ b/coderd/inboxnotifications.go @@ -206,8 +206,8 @@ func (api *API) listInboxNotifications(rw http.ResponseWriter, r *http.Request) ctx = r.Context() apikey = httpmw.APIKey(r) - targets = p.UUIDs(vals, []uuid.UUID{}, "targets") - templates = p.UUIDs(vals, []uuid.UUID{}, "templates") + targets = p.UUIDs(vals, nil, "targets") + templates = p.UUIDs(vals, nil, "templates") readStatus = p.String(vals, "all", "read_status") startingBefore = p.UUID(vals, uuid.Nil, "starting_before") ) @@ -296,7 +296,7 @@ func (api *API) updateInboxNotificationReadStatus(rw http.ResponseWriter, r *htt notificationID, ok := httpmw.ParseUUIDParam(rw, r, "id") if !ok { - + return } var body codersdk.UpdateInboxNotificationReadStatusRequest diff --git a/codersdk/inboxnotification.go b/codersdk/inboxnotification.go index e72c5c158c..6d21aead5a 100644 --- a/codersdk/inboxnotification.go +++ b/codersdk/inboxnotification.go @@ -47,10 +47,10 @@ type ListInboxNotificationsResponse struct { func ListInboxNotificationsRequestToQueryParams(req ListInboxNotificationsRequest) []RequestOption { var opts []RequestOption - if len(req.Targets) > 0 { + if req.Targets != "" { opts = append(opts, WithQueryParam("targets", req.Targets)) } - if len(req.Templates) > 0 { + if req.Templates != "" { opts = append(opts, WithQueryParam("templates", req.Templates)) } if req.ReadStatus != "" { diff --git a/site/src/api/typesGenerated.ts b/site/src/api/typesGenerated.ts index adbd0e9224..236e48e093 100644 --- a/site/src/api/typesGenerated.ts +++ b/site/src/api/typesGenerated.ts @@ -1161,10 +1161,10 @@ export interface LinkConfig { // From codersdk/inboxnotification.go export interface ListInboxNotificationsRequest { - readonly Targets: readonly string[]; - readonly Templates: readonly string[]; - readonly ReadStatus: string; - readonly StartingBefore: string; + readonly targets?: string; + readonly templates?: string; + readonly read_status?: string; + readonly starting_before?: string; } // From codersdk/inboxnotification.go