From ee6995783fcad4d796b2a93a11255d91b44488da Mon Sep 17 00:00:00 2001
From: Alex <alex.tran1502@gmail.com>
Date: Tue, 7 May 2024 15:00:38 -0500
Subject: [PATCH] fix(mobile): add user to album using new dto property (#9312)

* fix(mobile): add user to album using new DTO property

* fix(mobile): add user to album using new DTO property
---
 mobile/lib/services/album.service.dart | 6 +++++-
 server/src/dtos/album.dto.ts           | 1 -
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mobile/lib/services/album.service.dart b/mobile/lib/services/album.service.dart
index 45c6076fbd..bdf38a42af 100644
--- a/mobile/lib/services/album.service.dart
+++ b/mobile/lib/services/album.service.dart
@@ -279,9 +279,13 @@ class AlbumService {
     Album album,
   ) async {
     try {
+      final List<AlbumUserAddDto> albumUsers = sharedUserIds
+          .map((userId) => AlbumUserAddDto(userId: userId))
+          .toList();
+
       final result = await _apiService.albumApi.addUsersToAlbum(
         album.remoteId!,
-        AddUsersDto(sharedUserIds: sharedUserIds),
+        AddUsersDto(albumUsers: albumUsers),
       );
       if (result != null) {
         album.sharedUsers
diff --git a/server/src/dtos/album.dto.ts b/server/src/dtos/album.dto.ts
index f6a954dcdd..fb4aff9485 100644
--- a/server/src/dtos/album.dto.ts
+++ b/server/src/dtos/album.dto.ts
@@ -25,7 +25,6 @@ export class AlbumUserAddDto {
 
 export class AddUsersDto {
   @ValidateUUID({ each: true, optional: true })
-  @ArrayNotEmpty()
   @PropertyLifecycle({ deprecatedAt: 'v1.102.0' })
   sharedUserIds?: string[];