update position table, set selected table
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
@@ -36,4 +37,28 @@ class TableRepository implements ITableRepository {
|
||||
return left(const TableFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<TableFailure, Table>> updatePosition({
|
||||
required String id,
|
||||
required Offset position,
|
||||
}) async {
|
||||
try {
|
||||
final result = await _remoteDataProvider.updatePosition(
|
||||
id: id,
|
||||
position: position,
|
||||
);
|
||||
|
||||
if (result.hasError) {
|
||||
return left(result.error!);
|
||||
}
|
||||
|
||||
final table = result.data!.toDomain();
|
||||
|
||||
return right(table);
|
||||
} catch (e) {
|
||||
log('updatePositionTableError', name: _logName, error: e);
|
||||
return left(const TableFailure.unexpectedError());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user