Initial commit: unionflow-mobile-apps
Application Flutter complète (sans build artifacts). Signed-off-by: lions dev Team
This commit is contained in:
23
lib/features/profile/domain/usecases/update_avatar.dart
Normal file
23
lib/features/profile/domain/usecases/update_avatar.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
/// Use Case: Mettre à jour la photo de profil
|
||||
library update_avatar;
|
||||
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../../members/data/models/membre_complete_model.dart';
|
||||
import '../repositories/profile_repository.dart';
|
||||
|
||||
/// Met à jour la photo de profil (avatar) d'un membre
|
||||
/// Utilise l'endpoint de mise à jour générale avec copyWith
|
||||
@injectable
|
||||
class UpdateAvatar {
|
||||
final IProfileRepository _repository;
|
||||
|
||||
UpdateAvatar(this._repository);
|
||||
|
||||
/// Exécute le use case
|
||||
/// [id] : Identifiant du membre
|
||||
/// [photoUrl] : URL de la nouvelle photo de profil
|
||||
/// Retourne le profil mis à jour avec la nouvelle photo
|
||||
Future<MembreCompletModel> call(String id, String photoUrl) async {
|
||||
return _repository.updateAvatar(id, photoUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user