Skip to content

[Bug]: Incorrect code snippet for document service update with populate #2355

Closed
@cody-fjorge

Description

@cody-fjorge

Link to the documentation page or resource

https://docs.strapi.io/dev-docs/api/document-service/populate#populating-with-update

Describe the bug

The code example is putting the document ID as the first param when it needs to be included in the single object param.

Additional context

Current:

strapi.documents("api::article.article").update("cjld2cjxh0000qzrmn831i7rn", {
  data: {
    title: "Test Article Update",
  },
  populate: ["headerImage"],
});

Suggested improvements or fixes

Fixed:

strapi.documents("api::article.article").update({
  documentId: "cjld2cjxh0000qzrmn831i7rn",
  data: {
    title: "Test Article Update",
  },
  populate: ["headerImage"],
});

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions