Set default parameter values for useCampaigns.

This commit is contained in:
Gan Eng Chin 2023-03-19 23:17:22 +08:00
parent 458c16bad9
commit 11683be1a8
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 3 additions and 6 deletions

View File

@ -27,13 +27,10 @@ type UseCampaignsType = {
/**
* Custom hook to get campaigns.
*
* @param page Page number. First page is `1`.
* @param perPage Page size, i.e. number of records in one page.
* @param page Page number. Default is `1`.
* @param perPage Page size, i.e. number of records in one page. Default is `5`.
*/
export const useCampaigns = (
page: number,
perPage: number
): UseCampaignsType => {
export const useCampaigns = ( page = 1, perPage = 5 ): UseCampaignsType => {
const { data: channels } = useRegisteredChannels();
return useSelect(