1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Fix issue on conversation update

This commit is contained in:
2019-05-01 11:30:55 +02:00
parent 0b1e579a41
commit 9d20c407fc
3 changed files with 20 additions and 2 deletions

View File

@ -46,6 +46,17 @@ abstract class ModelDatabaseHelper<T extends CacheModel> {
return null;
}
/// Delete an entry from the database with a specified [id]
///
/// Return true if at least one entry was deleted / false else
Future<bool> delete(int id) async {
return await (await DatabaseHelper.get()).delete(
tableName(),
where: '${BaseTableContract.C_ID} = ?',
whereArgs: [id],
) > 0;
}
/// Get all the entries from the table
Future<List<T>> getAll() async {
List<Map> maps = await (await DatabaseHelper.get()).query(tableName());