Skip to content

exeute "withSearch" with "readItem" and "version attrbiute" and a lot of fields #24038

@schtiewen

Description

@schtiewen

Describe the Bug

Hi,

we've a lot of fields and cannot use the normale http GET function, because the url is to long.
that is the reason, that we should use the withSearch function.

now, we've the problem with the directus version attribute.

flow:

  • with "withSearch" and "readItems", we're looking for a specific directus item with a path and get the ID back

problem:

  • with "withSearch" and "readItem", the version attribute is ignored
  • with the "readItems" and without the "withSearch", it will be work but than we've a to long url, because we've a lot of dynamic fields ('blocks').

how could we fetch a specific version of an entity, but use the "withSearch" function?

To Reproduce

const pagesResponse = await directus.request( withSearch( readItems('pages', { filter: { path: { path: path } }, fields: [ "id" ], version: version }) ) );

the version attribute is ignored


const response = await directus.request( readItem('pages', 3, { fields: PageFields, version: version }) );

the url is to long and we get a http status 431 back


Directus Version

v11.2.1

Hosting Strategy

Self-Hosted (Custom)

Database

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions