Skip to content

status:draft not working when creating a document with the Rest API #21544

@maccomaccomaccomacco

Description

@maccomaccomaccomacco

Bug report

Required System information

  • Node.js version: 20
  • NPM version: 9
  • Strapi version: 5.0.1
  • Database: sqlite
  • Operating system: mac
  • Is your project Javascript or Typescript: JS

Describe the bug

Trying to create a document in draft status on a content type that has draft&published enabled doesn't work, the document gets created and published.

Steps to reproduce the behavior

  1. Create a project using the example dataset in v5; you'll also have an article content type with draft&publish enabled
  2. Send an api request to create a document on the Article content type with status: draft
{ 
  "data": {
    "title": "Article 1"
  },
  "status": "draft"
}

Expected behavior

The document is created and it's in draft status

Metadata

Metadata

Labels

severity: highIf it breaks the basic use of the productversion: 5Issue is present in Strapi 5

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions