Skip to content

Commit 9f4be9a

Browse files
authored
fix: return the full response from users.push_subscriptions.list() (#77)
Makes sure that the full response, including `page` and `page_count` is returned from the `users.push_subscriptions.list()` method.
1 parent b5f4b68 commit 9f4be9a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/ninety-bears-perform.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'magicbell': patch
3+
---
4+
5+
return the full response data from users.push_subscriptions.list()

packages/codegen/src/openapi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function getRootPathMethods(document: OpenAPI.Document, path: string) {
6565
const name = camelCase(operation.operationId.slice(rootPath.length + 1 + (group ? subPath.length + 1 : 0)));
6666
const type = name === 'list' ? 'list' : null;
6767

68-
const methodEntity = group ? snakeCase(group) : entity;
68+
const methodEntity = group ? snakeCase(group.replace(/s$/, '')) : entity;
6969
const methodPath = apiPath.replace(`/${path}`, '').replace(/^\//, '');
7070

7171
const urlParams = (apiPath.match(/{\w+}/g) || []).map((param) => param.replace(/[{}]/g, ''));

packages/magicbell/src/resources/users/push-subscriptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type ListUsersPushSubscriptionsPayload = FromSchema<typeof schemas.ListUsersPush
1212

1313
export class UsersPushSubscriptions extends Resource {
1414
path = 'users';
15-
entity = 'push_subscriptions';
15+
entity = 'push_subscription';
1616

1717
/**
1818
* Fetch a user's push subscriptions. Returns a paginated list of web and mobile

0 commit comments

Comments
 (0)