Skip to content

Commit

Permalink
Change sort keys
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Oct 27, 2024
1 parent c593f44 commit a9e3fd4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/contributions.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func listContributions(c *gin.Context) {
start, _ := strconv.Atoi(c.Query("start"))
limit, _ := strconv.Atoi(c.Query("limit"))
limit = int(math.Max(1.0, float64(limit)))
contributions, err := database.Query[models.Contribution]("contributions", bson.D{}, "title", start, limit)
contributions, err := database.Query[models.Contribution]("contributions", bson.D{}, "_id", start, limit)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down
2 changes: 1 addition & 1 deletion server/persons.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func listPersons(c *gin.Context) {
start, _ := strconv.Atoi(c.Query("start"))
limit, _ := strconv.Atoi(c.Query("limit"))
limit = int(math.Max(1.0, float64(limit)))
persons, err := database.Query[models.Person]("persons", bson.D{}, "title", start, limit)
persons, err := database.Query[models.Person]("persons", bson.D{}, "name", start, limit)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down
2 changes: 1 addition & 1 deletion server/publishers.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func listPublishers(c *gin.Context) {
start, _ := strconv.Atoi(c.Query("start"))
limit, _ := strconv.Atoi(c.Query("limit"))
limit = int(math.Max(1.0, float64(limit)))
publishers, err := database.Query[models.Publisher]("publishers", bson.D{}, "title", start, limit)
publishers, err := database.Query[models.Publisher]("publishers", bson.D{}, "name", start, limit)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down
2 changes: 1 addition & 1 deletion server/studios.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func listStudios(c *gin.Context) {
start, _ := strconv.Atoi(c.Query("start"))
limit, _ := strconv.Atoi(c.Query("limit"))
limit = int(math.Max(1.0, float64(limit)))
studios, err := database.Query[models.Studio]("studios", bson.D{}, "title", start, limit)
studios, err := database.Query[models.Studio]("studios", bson.D{}, "name", start, limit)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down
2 changes: 1 addition & 1 deletion server/systems.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func listSystems(c *gin.Context) {
start, _ := strconv.Atoi(c.Query("start"))
limit, _ := strconv.Atoi(c.Query("limit"))
limit = int(math.Max(1.0, float64(limit)))
systems, err := database.Query[models.System]("systems", bson.D{}, "title", start, limit)
systems, err := database.Query[models.System]("systems", bson.D{}, "game_system", start, limit)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
Expand Down

0 comments on commit a9e3fd4

Please sign in to comment.