forked from eatvio/eatvio_app
26 lines
809 B
Dart
26 lines
809 B
Dart
import 'package:eatvio_app/data/models/userRegistrationModel/user_registration_model.dart';
|
|
import 'package:eatvio_app/features/registration/models/location_model.dart';
|
|
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
|
|
|
class RegistrationRepository {
|
|
final RegistrationService registrationService;
|
|
|
|
RegistrationRepository({required this.registrationService});
|
|
|
|
Future<String> tryRegister(UserRegistrationSheet sheet) async {
|
|
try {
|
|
return (await registrationService.register(sheet: sheet.toJson()))['token']!;
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
|
|
Future<LocationModel> getLocationsListByQuery(String query) async {
|
|
try {
|
|
return (await registrationService.getLocationsByAddress(query: query));
|
|
} catch (e) {
|
|
rethrow;
|
|
}
|
|
}
|
|
}
|