Update lib/screens/manage_collection_screen.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
2699242fdf
commit
040a8bd1f2
1 changed files with 6 additions and 2 deletions
|
|
@ -86,17 +86,21 @@ class _ManageCollectionScreenState extends State<ManageCollectionScreen> {
|
|||
|
||||
if (result != true) return;
|
||||
|
||||
final trimmedDesc = descCtrl.text.trim();
|
||||
final String? description =
|
||||
trimmedDesc.isEmpty ? null : trimmedDesc;
|
||||
|
||||
try {
|
||||
await CollectionService.update(
|
||||
collectionId: _collection.id,
|
||||
name: ctrl.text.trim(),
|
||||
description: descCtrl.text.trim(),
|
||||
description: description,
|
||||
);
|
||||
setState(() {
|
||||
_collection = Collection(
|
||||
id: _collection.id,
|
||||
name: ctrl.text.trim(),
|
||||
description: descCtrl.text.trim(),
|
||||
description: description,
|
||||
ownerId: _collection.ownerId,
|
||||
createdAt: _collection.createdAt,
|
||||
role: _collection.role,
|
||||
|
|
|
|||
Loading…
Reference in a new issue