numero de solicitudes
This commit is contained in:
@@ -37,6 +37,8 @@ class ServiceBloc extends Bloc<ServiceEvent, ServiceState> {
|
||||
_onLoadPendingServicesForProfessional);
|
||||
on<UpdateProfessionalScored>(_onUpdateProfessionalScored);
|
||||
on<UpdateUserScored>(_onUpdateUserScored);
|
||||
on<CountPendingServicesForProfessional>(
|
||||
_onCountPendingServicesForProfessional);
|
||||
}
|
||||
|
||||
void _onCreateService(CreateService event, Emitter<ServiceState> emit) async {
|
||||
@@ -297,6 +299,22 @@ class ServiceBloc extends Bloc<ServiceEvent, ServiceState> {
|
||||
emit(CreateServiceFailure());
|
||||
}
|
||||
}
|
||||
|
||||
void _onCountPendingServicesForProfessional(
|
||||
CountPendingServicesForProfessional event,
|
||||
Emitter<ServiceState> emit) async {
|
||||
try {
|
||||
final count = await _serviceRepository
|
||||
.countPendingServicesForProfessional(event.professionalId);
|
||||
|
||||
|
||||
|
||||
emit(PendingServicesCountedLoaded(count));
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
emit(CreateServiceFailure());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceInfoUI {
|
||||
|
||||
Reference in New Issue
Block a user