getPostAndReview function
Implementation
Future<List<PostReview>?> getPostAndReview({String startDate = '', String endDate = '', String? businessId, bool showLoader = true}) async {
if (showLoader) appStore.setLoading(true);
try {
String businessId = "&${AddEventKeys.businessId}=${getIntAsync(SELECTED_BUSINESS_ID).toString()}";
PostAndReviewsModelResponse res = PostAndReviewsModelResponse.fromJson(await (handleResponse(await buildHttpResponse("${APIEndPoint.postReview}?user_id=${appStore.userId}$businessId", method: HttpMethod.GET))));
appStore.setLoading(false);
return await res.data!.postReviews;
} catch (e) {
appStore.setLoading(false);
throw errorSomethingWentWrong;
}
}