-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
GO-4459: REST API Docs & Refinement #2073
base: main
Are you sure you want to change the base?
Conversation
Coverage provided by https://github.com/seriousben/go-patch-cover-action |
… entire type for object
…ey for object relation value
…instead of list bug
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
core/api/internal/search/service.go:123
- Accessing the first element of 'sorts' in the Search function without confirming its existence may cause a runtime error. Ensure that 'sorts' is non-empty before accessing its first element.
dateToSortAfter := sorts[0].RelationKey
func (s *ListService) RemoveObjectFromList(ctx context.Context, spaceId string, listId string, objectId string) error { | ||
resp := s.mw.ObjectCollectionRemove(ctx, &pb.RpcObjectCollectionRemoveRequest{ | ||
ContextId: spaceId, | ||
ObjectIds: []string{objectId}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of RemoveObjectFromList accepts a single objectId, but the Service interface expects a slice of objectIds. Update the method signature (or the interface) so they match.
func (s *ListService) RemoveObjectFromList(ctx context.Context, spaceId string, listId string, objectId string) error { | |
resp := s.mw.ObjectCollectionRemove(ctx, &pb.RpcObjectCollectionRemoveRequest{ | |
ContextId: spaceId, | |
ObjectIds: []string{objectId}, | |
func (s *ListService) RemoveObjectFromList(ctx context.Context, spaceId string, listId string, objectIds []string) error { | |
resp := s.mw.ObjectCollectionRemove(ctx, &pb.RpcObjectCollectionRemoveRequest{ | |
ContextId: spaceId, | |
ObjectIds: objectIds, |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -48,18 +48,19 @@ func (s *SearchService) GlobalSearch(ctx context.Context, request SearchRequest, | |||
baseFilters := s.prepareBaseFilters() | |||
queryFilters := s.prepareQueryFilter(request.Query) | |||
sorts := s.prepareSorts(request.Sort) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing the first element of 'sorts' without validating that the slice is non-empty could lead to a panic. Consider adding a check before using sorts[0].
sorts := s.prepareSorts(request.Sort) | |
sorts := s.prepareSorts(request.Sort) | |
if len(sorts) == 0 { | |
return nil, 0, false, errors.New("no sorts provided") | |
} |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
last_modified
sort criterion as fallback forlast_opened
sortGET /spaces/:space_id
GET /spaces/:space_id/members/:member_id
GET /spaces/:space_id/lists/:list_id/objects
POST /spaces/:space_id/lists/:list_id/objects
DELETE /spaces/:space_id/lists/:list_id/objects
GET /spaces/:space_id/objects/:object_id
make swagger
for generation and format