Skip to content

Strapi sort does not work on id on REST endpoint #16135

@louisunlimited

Description

@louisunlimited

Bug report

Required System information

  • Node.js version: 18.11.10
  • NPM version: 8.19.2
  • Strapi version: 4.8.2
  • Database: Postgres
  • Operating system: Linux
  • Is your project Javascript or Typescript: Typescript

Describe the bug

After I upgrade my Strapi to 4.8.2, the sort=id:desc does not seem to work anymore, I was able to sort based on keys with in the attributes tag but not on id.

For example I was able to sort by createdAt but not id using this 🤔

/api/<list-type-name>?sort=createdAt%3Adesc

but not this

/api/<list-type-name>?sort=id%3Adesc

Steps to reproduce the behavior

  1. Go to any Strapi list type
  2. Try to request REST endpoint : /api/<list-type-name>?sort=id%3Adesc

Expected behavior

The output should be sorted by id, decreasing

Metadata

Metadata

Assignees

Labels

issue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:strapiSource is core/strapi package

Type

No type

Projects

Status

Fixed/Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions