Update lib/screens/manage_collection_screen.dart

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Lukas Müllner 2026-02-24 20:17:02 +01:00 committed by GitHub
parent 2699242fdf
commit 040a8bd1f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,17 +86,21 @@ class _ManageCollectionScreenState extends State<ManageCollectionScreen> {
if (result != true) return; if (result != true) return;
final trimmedDesc = descCtrl.text.trim();
final String? description =
trimmedDesc.isEmpty ? null : trimmedDesc;
try { try {
await CollectionService.update( await CollectionService.update(
collectionId: _collection.id, collectionId: _collection.id,
name: ctrl.text.trim(), name: ctrl.text.trim(),
description: descCtrl.text.trim(), description: description,
); );
setState(() { setState(() {
_collection = Collection( _collection = Collection(
id: _collection.id, id: _collection.id,
name: ctrl.text.trim(), name: ctrl.text.trim(),
description: descCtrl.text.trim(), description: description,
ownerId: _collection.ownerId, ownerId: _collection.ownerId,
createdAt: _collection.createdAt, createdAt: _collection.createdAt,
role: _collection.role, role: _collection.role,