1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00

GO-4459: Fix service dependencies for search

This commit is contained in:
Jannis Metrikat 2024-12-31 12:54:28 +01:00
parent 239a606eb3
commit 5bae6a1585
No known key found for this signature in database
GPG key ID: B223CAC5AAF85615
2 changed files with 3 additions and 3 deletions

View file

@ -32,8 +32,8 @@ type SearchService struct {
AccountInfo *model.AccountInfo
}
func NewService(mw service.ClientCommandsServer) *SearchService {
return &SearchService{mw: mw, spaceService: space.NewService(mw), objectService: object.NewService(mw)}
func NewService(mw service.ClientCommandsServer, spaceService *space.SpaceService, objectService *object.ObjectService) *SearchService {
return &SearchService{mw: mw, spaceService: spaceService, objectService: objectService}
}
func (s *SearchService) Search(ctx context.Context, searchQuery string, objectType string, offset, limit int) (objects []object.Object, total int, hasMore bool, err error) {

View file

@ -41,9 +41,9 @@ func NewServer(mw service.ClientCommandsServer, mwInternal core.MiddlewareIntern
authService: auth.NewService(mw),
objectService: object.NewService(mw),
spaceService: space.NewService(mw),
searchService: search.NewService(mw),
}
s.searchService = search.NewService(mw, s.spaceService, s.objectService)
s.engine = s.NewRouter()
s.srv = &http.Server{
Addr: httpPort,