fmt and lint

This commit is contained in:
defelmnq
2025-03-13 23:19:37 +00:00
parent 75c310d4d7
commit 07ab7c4064
3 changed files with 9 additions and 9 deletions

View File

@ -206,8 +206,8 @@ func (api *API) listInboxNotifications(rw http.ResponseWriter, r *http.Request)
ctx = r.Context() ctx = r.Context()
apikey = httpmw.APIKey(r) apikey = httpmw.APIKey(r)
targets = p.UUIDs(vals, []uuid.UUID{}, "targets") targets = p.UUIDs(vals, nil, "targets")
templates = p.UUIDs(vals, []uuid.UUID{}, "templates") templates = p.UUIDs(vals, nil, "templates")
readStatus = p.String(vals, "all", "read_status") readStatus = p.String(vals, "all", "read_status")
startingBefore = p.UUID(vals, uuid.Nil, "starting_before") 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") notificationID, ok := httpmw.ParseUUIDParam(rw, r, "id")
if !ok { if !ok {
return
} }
var body codersdk.UpdateInboxNotificationReadStatusRequest var body codersdk.UpdateInboxNotificationReadStatusRequest

View File

@ -47,10 +47,10 @@ type ListInboxNotificationsResponse struct {
func ListInboxNotificationsRequestToQueryParams(req ListInboxNotificationsRequest) []RequestOption { func ListInboxNotificationsRequestToQueryParams(req ListInboxNotificationsRequest) []RequestOption {
var opts []RequestOption var opts []RequestOption
if len(req.Targets) > 0 { if req.Targets != "" {
opts = append(opts, WithQueryParam("targets", req.Targets)) opts = append(opts, WithQueryParam("targets", req.Targets))
} }
if len(req.Templates) > 0 { if req.Templates != "" {
opts = append(opts, WithQueryParam("templates", req.Templates)) opts = append(opts, WithQueryParam("templates", req.Templates))
} }
if req.ReadStatus != "" { if req.ReadStatus != "" {

View File

@ -1161,10 +1161,10 @@ export interface LinkConfig {
// From codersdk/inboxnotification.go // From codersdk/inboxnotification.go
export interface ListInboxNotificationsRequest { export interface ListInboxNotificationsRequest {
readonly Targets: readonly string[]; readonly targets?: string;
readonly Templates: readonly string[]; readonly templates?: string;
readonly ReadStatus: string; readonly read_status?: string;
readonly StartingBefore: string; readonly starting_before?: string;
} }
// From codersdk/inboxnotification.go // From codersdk/inboxnotification.go