Skip to content

Commit

Permalink
fix: list channel subscribers
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman035 committed Jul 5, 2024
1 parent 2b636c5 commit f13863e
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 530 deletions.
2 changes: 1 addition & 1 deletion packages/dnode/src/lib/channels/getSubscribers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const getSubscribers = async (
}
const _channel = await getCAIPAddress(env, channel, 'Channel');
const API_BASE_URL = await getAPIBaseUrls(env);
let apiEndpoint = `${API_BASE_URL}/v1/channels/${_channel}/subscribers?page=${page}&limit=${limit}&setting=${setting}`;
let apiEndpoint = `${API_BASE_URL}/v1/messaging/settings/${_channel}/ETH_TEST_GOERLI`;
if (category) {
apiEndpoint = apiEndpoint + `&category=${category}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export type SubscriptionOptions = {
};
export type ChannelInfoOptions = {
channel?: string;
page?: number;
limit?: number;
category?: number;
setting?: boolean;
// page?: number;
// limit?: number;
// category?: number;
// setting?: boolean;
raw?: boolean;
};

Expand Down
27 changes: 9 additions & 18 deletions packages/dnode/src/lib/pushNotification/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,15 @@ export class Channel extends PushNotificationBaseClass {
channel = validateCAIP(channel!)
? channel
: getFallbackETHCAIPAddress(this.env!, channel!);
if (options && options.page) {
return await PUSH_CHANNEL.getSubscribers({
channel: channel!,
env: this.env,
page: options.page,
limit: options.limit ?? 10,
setting: options.setting ?? false,
category: options.category,
raw: options.raw,
});
} else {
/** @dev - Fallback to deprecated method when page is not provided ( to ensure backward compatibility ) */
/** @notice - This will be removed in V2 Publish */
return await PUSH_CHANNEL._getSubscribers({
channel: channel!,
env: this.env,
});
}
return await PUSH_CHANNEL.getSubscribers({
channel: channel!,
env: this.env,
// page: options.page,
// limit: options.limit ?? 10,
// setting: options.setting ?? false,
// category: options.category,
raw: options?.raw ?? true,
});
} catch (error) {
throw new Error(`Push SDK Error: API : channel::subscribers : ${error}`);
}
Expand Down
87 changes: 0 additions & 87 deletions packages/dnode/tests/lib/aliasChains/arbitrum.test.ts

This file was deleted.

87 changes: 0 additions & 87 deletions packages/dnode/tests/lib/aliasChains/berachain.test.ts

This file was deleted.

87 changes: 0 additions & 87 deletions packages/dnode/tests/lib/aliasChains/optimism.test.ts

This file was deleted.

Loading

0 comments on commit f13863e

Please sign in to comment.