Implemented editable album title (#130)

* Replace static title text with a text edit field
* Implement endpoint for updating album info
* Implement changing title
* Only the owner can change the title
This commit is contained in:
Alex
2022-04-28 23:46:37 -05:00
committed by GitHub
parent c5c7a134dd
commit 38e0178c81
10 changed files with 290 additions and 29 deletions

View File

@@ -138,4 +138,23 @@ class SharedAlbumService {
return false;
}
}
Future<bool> changeTitleAlbum(String albumId, String ownerId, String newAlbumTitle) async {
try {
Response res = await _networkService.patchRequest(url: 'shared/updateInfo', data: {
"albumId": albumId,
"ownerId": ownerId,
"albumName": newAlbumTitle,
});
if (res.statusCode != 200) {
return false;
}
return true;
} catch (e) {
debugPrint("Error deleteAlbum ${e.toString()}");
return false;
}
}
}