diff --git a/lib/data/dao/group_dao.dart b/lib/data/dao/group_dao.dart index 999200d..beecc9d 100644 --- a/lib/data/dao/group_dao.dart +++ b/lib/data/dao/group_dao.dart @@ -181,7 +181,7 @@ class GroupDao extends DatabaseAccessor with _$GroupDaoMixin { /// Updates the name of the group with the given [id] to [newName]. /// Returns `true` if more than 0 rows were affected, otherwise `false`. - Future updateGroupname({ + Future updateGroupName({ required String groupId, required String newName, }) async { @@ -192,6 +192,21 @@ class GroupDao extends DatabaseAccessor with _$GroupDaoMixin { return rowsAffected > 0; } + /// Updates the description of the group with the given [groupId] to [newDescription]. + /// Returns `true` if more than 0 rows were affected, otherwise `false`. + Future updateGroupDescription({ + required String groupId, + required String? newDescription, + }) async { + final rowsAffected = + await (update(groupTable)..where((g) => g.id.equals(groupId))).write( + GroupTableCompanion(description: Value(newDescription)), + ); + return rowsAffected > 0; + } + + + /// Retrieves the number of groups in the database. Future getGroupCount() async { final count =