forked from eatvio/eatvio_app
feat(profile): add search in subs
This commit is contained in:
@@ -9,19 +9,19 @@ class SubCubit extends Cubit<SubState> {
|
||||
required this.profileRepository,
|
||||
}) : super(const SubState());
|
||||
|
||||
getSubscriptions(String slug) async {
|
||||
getSubscriptions(String slug, [String? query]) async {
|
||||
emit(const SubState.loading());
|
||||
try {
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscriptionsBySlug(slug)));
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscriptionsBySlug(slug, query)));
|
||||
} catch (e) {
|
||||
emit(SubState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
getSubscribers(String slug) async {
|
||||
getSubscribers(String slug, [String? query]) async {
|
||||
emit(const SubState.loading());
|
||||
try {
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscribersBySlug(slug)));
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscribersBySlug(slug, query)));
|
||||
} catch (e) {
|
||||
emit(SubState.error(errorMessage: e.toString()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user