diff --git a/internal/company/repository.go b/internal/company/repository.go index f186aa8..b82cdc7 100644 --- a/internal/company/repository.go +++ b/internal/company/repository.go @@ -101,7 +101,16 @@ func (r *companyRepository) GetByID(ctx context.Context, id string) (*Company, e // GetByIDs retrieves companies by IDs func (r *companyRepository) GetByIDs(ctx context.Context, ids []string) ([]Company, error) { - companies, err := r.ormRepo.FindAll(ctx, bson.M{"_id": bson.M{"$in": ids}}, orm.NewPaginationBuilder().Build()) + objectIDs := make([]bson.ObjectID, len(ids)) + for i, id := range ids { + objectID, err := bson.ObjectIDFromHex(id) + if err != nil { + return nil, err + } + objectIDs[i] = objectID + } + + companies, err := r.ormRepo.FindAll(ctx, bson.M{"_id": bson.M{"$in": objectIDs}}, orm.NewPaginationBuilder().Build()) if err != nil { return nil, err }