-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/alpha' into push-chat-reply
- Loading branch information
Showing
22 changed files
with
2,244 additions
and
2,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { getCAIPAddress, getAPIBaseUrls, getQueryParams } from '../helpers'; | ||
import Constants, { ENV } from '../constants'; | ||
import { axiosGet } from '../utils/axiosUtil'; | ||
import CONSTANTS from '../constantsV2'; | ||
|
||
/** | ||
* GET v1/channels/tags/all | ||
*/ | ||
export type GetAllTagsOptionsType = { | ||
page?: number; | ||
limit?: number; | ||
order?: string; | ||
filter?:string; | ||
env?: ENV; | ||
}; | ||
|
||
/** | ||
* Returns the tags available based on the filter provided | ||
*/ | ||
export const getAllTags = async (options: GetAllTagsOptionsType) => { | ||
const { | ||
page=1, | ||
limit=10, | ||
order=CONSTANTS.FILTER.CHANNEL_LIST.ORDER.DESCENDING, | ||
filter=CONSTANTS.FILTER.TAGS.PUSH, | ||
env = Constants.ENV.PROD, | ||
} = options || {}; | ||
|
||
const API_BASE_URL = getAPIBaseUrls(env); | ||
const apiEndpoint = `${API_BASE_URL}/v1/channels`; | ||
const queryObj = { | ||
page, | ||
limit, | ||
order, | ||
filter, | ||
} | ||
const requestUrl = `${apiEndpoint}/tags/all?${getQueryParams(queryObj)}`; | ||
return await axiosGet(requestUrl) | ||
.then((response) => response.data?.tags) | ||
.catch((err) => { | ||
console.error(`[EPNS-SDK] - API ${requestUrl}: `, err); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.