Skip to content

Commit

Permalink
feat: Add name query to list groups
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedylandev committed Sep 11, 2024
1 parent 52f575c commit 2508a9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/core/groups/listGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
8 changes: 4 additions & 4 deletions src/core/pinataSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export type GroupResponseItem = {
};

export type GroupQueryOptions = {
nameContains?: string;
name?: string;
limit?: number;
pageToken?: string;
isPublic?: boolean;
Expand Down

0 comments on commit 2508a9f

Please sign in to comment.