From 2508a9f3e3c713e1bae65f8a60462b33691d8cc1 Mon Sep 17 00:00:00 2001 From: Steve Date: Wed, 11 Sep 2024 19:43:51 -0400 Subject: [PATCH] feat: Add name query to list groups --- src/core/groups/listGroups.ts | 5 ++--- src/core/pinataSDK.ts | 8 ++++---- src/core/types.ts | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/groups/listGroups.ts b/src/core/groups/listGroups.ts index e5f77e9..2426b1f 100644 --- a/src/core/groups/listGroups.ts +++ b/src/core/groups/listGroups.ts @@ -67,12 +67,11 @@ export const listGroups = async ( const params = new URLSearchParams(); if (options) { - const { pageToken, nameContains, limit, isPublic } = options; + const { pageToken, name, limit, isPublic } = options; if (pageToken) params.append("pageToken", pageToken.toString()); if (isPublic) params.append("isPublic", isPublic.toString()); - if (nameContains !== undefined) - params.append("nameContains", nameContains.toString()); + if (name) params.append("name", name); if (limit !== undefined) params.append("limit", limit.toString()); } diff --git a/src/core/pinataSDK.ts b/src/core/pinataSDK.ts index 8f42915..f20465d 100644 --- a/src/core/pinataSDK.ts +++ b/src/core/pinataSDK.ts @@ -673,10 +673,10 @@ class FilterGroups { this.config = config; } - // name(nameContains: string): FilterGroups { - // this.query.nameContains = nameContains; - // return this; - // } + name(name: string): FilterGroups { + this.query.name = name; + return this; + } limit(limit: number): FilterGroups { this.query.limit = limit; diff --git a/src/core/types.ts b/src/core/types.ts index 0a98d8c..73e234b 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -326,7 +326,7 @@ export type GroupResponseItem = { }; export type GroupQueryOptions = { - nameContains?: string; + name?: string; limit?: number; pageToken?: string; isPublic?: boolean;