Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Nov 6, 2024
1 parent 7b03e41 commit dc90747
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/sweetrpg/catalog-data v0.0.11
github.com/sweetrpg/common v0.0.7
github.com/sweetrpg/db v0.0.156
go.jtlabs.io/query v1.6.1
go.mongodb.org/mongo-driver v1.17.1
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.56.0
go.opentelemetry.io/otel v1.31.0
Expand Down Expand Up @@ -80,6 +79,7 @@ require (
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/zerodha/logf v0.5.5 // indirect
go.jtlabs.io/query v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 // indirect
go.opentelemetry.io/otel/metric v1.31.0 // indirect
Expand Down
16 changes: 7 additions & 9 deletions server/licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
apiutil "github.com/sweetrpg/api-core/util"
"github.com/sweetrpg/catalog-data/data"
"github.com/sweetrpg/common/logging"
options "go.jtlabs.io/query"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.opentelemetry.io/otel"
Expand Down Expand Up @@ -75,16 +74,15 @@ func getLicenseVolumes(c *gin.Context) {
return
}

opt, _ := options.FromQuerystring(c.Request.URL.RawQuery)
params := apiutil.GetQueryParams(c.Request.URL.RawQuery)

filter := bson.D{
{"license_ids",
bson.D{{"$in", id}},
},
}
params.Filter = []apiutil.Filter{{
Field: "license_ids",
Operation: bson.D{{"$in", id}},
}}

span := tracing.BuildSpanWithOptions(c.Request.Context(), "licenses", "list-license-volumes", opt)
vos, err := data.GetVolumes(c.Request.Context(), filter, opt)
span := tracing.BuildSpanWithParams(c.Request.Context(), "licenses", "list-license-volumes", params)
vos, err := data.GetVolumes(c.Request.Context(), params)
span.End()
if err != nil {
sentry.CaptureException(err)
Expand Down
3 changes: 1 addition & 2 deletions server/reviews.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
apiutil "github.com/sweetrpg/api-core/util"
"github.com/sweetrpg/catalog-data/data"
"github.com/sweetrpg/common/logging"
"go.mongodb.org/mongo-driver/bson"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
oteltrace "go.opentelemetry.io/otel/trace"
Expand All @@ -39,7 +38,7 @@ func listReviews(c *gin.Context) {
params := apiutil.GetQueryParams(c.Request.URL.RawQuery)

span := tracing.BuildSpanWithParams(c.Request.Context(), "reviews", "list-reviews", params)
vos, err := data.GetReviews(c.Request.Context(), bson.D{}, params)
vos, err := data.GetReviews(c.Request.Context(), params)
span.End()
if err != nil {
sentry.CaptureException(err)
Expand Down

0 comments on commit dc90747

Please sign in to comment.