From 0a6084b970a22f7ac423a9c8396465023b511e77 Mon Sep 17 00:00:00 2001 From: Juan M Date: Tue, 2 Apr 2024 01:05:19 -0300 Subject: [PATCH] Documentation on search drops --- docs/pages/packages/drops.mdx | 1 + docs/pages/packages/drops/SearchDrops.mdx | 31 +++++++++++++++++++++++ docs/pages/packages/drops/_meta.json | 3 +++ packages/drops/README.md | 1 + 4 files changed, 36 insertions(+) create mode 100644 docs/pages/packages/drops/SearchDrops.mdx create mode 100644 docs/pages/packages/drops/_meta.json diff --git a/docs/pages/packages/drops.mdx b/docs/pages/packages/drops.mdx index 62dd820c..d58a9c6c 100644 --- a/docs/pages/packages/drops.mdx +++ b/docs/pages/packages/drops.mdx @@ -10,6 +10,7 @@ - Update a Drop attributes - Fetch a single Drop - Fetch multiple Drops +- Search Drops ## Installation diff --git a/docs/pages/packages/drops/SearchDrops.mdx b/docs/pages/packages/drops/SearchDrops.mdx new file mode 100644 index 00000000..03d6512b --- /dev/null +++ b/docs/pages/packages/drops/SearchDrops.mdx @@ -0,0 +1,31 @@ +# Search Drops + +There are two ways that drops can be searched, by exact word in name or fuzzy +search in name and description. + +## Exact word search + +When searching for a whole word, use `fetch` method: + +```typescript + const data: PaginatedResult = await dropsClient.fetch({ + sortField: DropsSortFields.Name, + sortDir: Order.ASC, + limit: 3, + offset: 0, + name: 'POAP', + }); +``` + +## Fuzzy search + +When given a generic search input, and to match any part of the words used in +the name of the description, use `search` method: + +```typescript + const data: PaginatedResult = await dropsClient.search({ + limit: 3, + offset: 0, + search: 'POAP', + }); +``` diff --git a/docs/pages/packages/drops/_meta.json b/docs/pages/packages/drops/_meta.json new file mode 100644 index 00000000..23cd2cff --- /dev/null +++ b/docs/pages/packages/drops/_meta.json @@ -0,0 +1,3 @@ +{ + "SearchDrops": "Search Drops" +} diff --git a/packages/drops/README.md b/packages/drops/README.md index 62dd820c..d58a9c6c 100644 --- a/packages/drops/README.md +++ b/packages/drops/README.md @@ -10,6 +10,7 @@ - Update a Drop attributes - Fetch a single Drop - Fetch multiple Drops +- Search Drops ## Installation