feat(mobile): edit location action (#19645)
* change dto from integer to double * feat(mobile): edit location action * patch openapi * refactor in provider * fix lint * chore: not showing success prompt if dimissed * i18n --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -172,4 +172,26 @@ class ActionNotifier extends Notifier<void> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<ActionResult?> editLocation(
|
||||
ActionSource source,
|
||||
BuildContext context,
|
||||
) async {
|
||||
final ids = _getIdsForSource<RemoteAsset>(source);
|
||||
try {
|
||||
final isEdited = await _service.editLocation(ids, context);
|
||||
if (!isEdited) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ActionResult(count: ids.length, success: true);
|
||||
} catch (error, stack) {
|
||||
_logger.severe('Failed to edit location for assets', error, stack);
|
||||
return ActionResult(
|
||||
count: ids.length,
|
||||
success: false,
|
||||
error: error.toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/local_asset.repository.dart';
|
||||
import 'package:immich_mobile/infrastructure/repositories/remote_asset.repository.dart';
|
||||
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
||||
|
||||
final localAssetRepository = Provider<DriftLocalAssetRepository>(
|
||||
(ref) => DriftLocalAssetRepository(ref.watch(driftProvider)),
|
||||
);
|
||||
|
||||
final remoteAssetRepository = Provider<DriftRemoteAssetRepository>(
|
||||
(ref) => DriftRemoteAssetRepository(ref.watch(driftProvider)),
|
||||
);
|
||||
|
||||
@@ -8,3 +8,7 @@ part 'exif.provider.g.dart';
|
||||
@Riverpod(keepAlive: true)
|
||||
IsarExifRepository exifRepository(Ref ref) =>
|
||||
IsarExifRepository(ref.watch(isarProvider));
|
||||
|
||||
final remoteExifRepository = Provider<DriftRemoteExifRepository>(
|
||||
(ref) => DriftRemoteExifRepository(ref.watch(driftProvider)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user