Skip to content

Commit

Permalink
empty request
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn committed Dec 2, 2024
1 parent 8c6a47b commit 6af1c3b
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 68 deletions.
3 changes: 2 additions & 1 deletion protobufs/api/v1/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ service NotificationService {
rpc ListNotifications (ListNotificationsRequest) returns (ListNotificationsResponse) {
option (auth) = true;
}
rpc UnreadNotifications (google.protobuf.Empty) returns (stream UnreadNotificationsResponse) {
rpc UnreadNotifications (UnreadNotificationsRequest) returns (stream UnreadNotificationsResponse) {
option (auth) = true;
}
}
Expand Down Expand Up @@ -47,6 +47,7 @@ message Notification {
}
}

message UnreadNotificationsRequest {}
message UnreadNotificationsResponse {
int64 count = 1;
}
13 changes: 6 additions & 7 deletions server/pkg/pb/api/v1/apiv1connect/notifications.connect.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

144 changes: 91 additions & 53 deletions server/pkg/pb/api/v1/notifications.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions server/rpc/v1/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"connectrpc.com/connect"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/emptypb"

"github.com/crlssn/getstronger/server/pkg/orm"
v1 "github.com/crlssn/getstronger/server/pkg/pb/api/v1"
Expand Down Expand Up @@ -109,7 +108,7 @@ func (h *notificationHandler) ListNotifications(ctx context.Context, req *connec
}, nil
}

func (h *notificationHandler) UnreadNotifications(ctx context.Context, _ *connect.Request[emptypb.Empty], res *connect.ServerStream[v1.UnreadNotificationsResponse]) error {
func (h *notificationHandler) UnreadNotifications(ctx context.Context, _ *connect.Request[v1.UnreadNotificationsRequest], res *connect.ServerStream[v1.UnreadNotificationsResponse]) error {
log := xcontext.MustExtractLogger(ctx)
userID := xcontext.MustExtractUserID(ctx)

Expand Down
Loading

0 comments on commit 6af1c3b

Please sign in to comment.