Skip to content

Commit

Permalink
fix: fix bug with communities.getCommunities
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed Jun 13, 2024
1 parent 9f1353e commit aa94e6a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"postbuild": "attw . -P && size-limit",
"lint": "tsc --noEmit",
"ci": "rm -rf dist && npm run lint && pnpm run test && pnpm run build",
"prepublish": "pnpm run ci",
"pprepublish": "pnpm run ci",
"release": "pnpm run ci && changeset publish",
"prepare": "husky install",
"size": "banal ./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions src/lib/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type RemovedRequests = keyof RemovedRequestsMap
export const getRequestsMap = {
get: true,
getMany: true,
getCommunities: true,
logout: true,
uploadPolicy: true,
} as const
Expand Down
14 changes: 14 additions & 0 deletions test/test.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ describe('PubPub', () => {
expect(json).toBeDefined()
})

it('should be able to get a community', async () => {
const {
body: [community],
} = await pubpub.community.getCommunities()

const { body: communtiy2 } = await pubpub.community.get({
params: {
id: community.id,
},
})

expect(communtiy2.id).toEqual(community.id)
})

it('should be able to get pubs', async () => {
const { body: pubs } = await pubpub.pub.getMany({
query: {
Expand Down

0 comments on commit aa94e6a

Please sign in to comment.