frontends icon indicating copy to clipboard operation
frontends copied to clipboard

[FEATURE] apiclient-next abstraction of Criteria

Open shyim opened this issue 1 year ago • 1 comments

Description

All search, search-ids support a Shopware Criteria. It's pretty annoying to craft that with raw objects. Maybe we can use the existing here? https://github.com/shopware/meteor-admin-sdk/blob/trunk/src/data/Criteria.ts

Use Case

Make live of devs easier when crafting custom search.

const criteria = new Criteria();

// do stuff with the criteria object

const keywords = await adminApiClient.invoke(
  "getProductSearchKeywordList post /search/product-search-keyword", 
criteria
);

Proposed Solution

No response

Alternatives Considered

No response

Additional Context

No response

shyim avatar Feb 04 '24 07:02 shyim

Priority would be to improve Criteria definition in the OpenAPI schema to make it complete. Currently, a lot is missing there (which also makes filling it more painful and requires advanced knowledge of how it works).

When it's complete we'll be able to prepare helper for creating Criteria, or even generate it from the schema definition, as it needs to rely only on that and be able to also include custom filters.

Help in improving that area of the OpenAPI schema would be appreciated :)

patzick avatar Feb 05 '24 12:02 patzick