outlet list
This commit is contained in:
@@ -33,4 +33,32 @@ class OutletRepository implements IOutletRepository {
|
||||
return left(const OutletFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<OutletFailure, List<Outlet>>> getList({
|
||||
int page = 1,
|
||||
int limit = 10,
|
||||
String? search,
|
||||
bool? isActive,
|
||||
}) async {
|
||||
try {
|
||||
final result = await _dataProvider.fetchList(
|
||||
page: page,
|
||||
limit: limit,
|
||||
search: search,
|
||||
isActive: isActive,
|
||||
);
|
||||
|
||||
if (result.hasError) {
|
||||
return left(result.error!);
|
||||
}
|
||||
|
||||
final outlets = result.data!.map((e) => e.toDomain()).toList();
|
||||
|
||||
return right(outlets);
|
||||
} catch (e, s) {
|
||||
log('getOutletListError', name: _logName, error: e, stackTrace: s);
|
||||
return left(const OutletFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user