mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Fix issue on conversation update
This commit is contained in:
@ -58,7 +58,14 @@ class ConversationsHelper {
|
||||
|
||||
final response = await request.exec();
|
||||
|
||||
return response.code == 200;
|
||||
if(response.code != 200)
|
||||
return false;
|
||||
|
||||
//Delete old conversation entry from the database
|
||||
await _conversationsDatabaseHelper.delete(settings.id);
|
||||
|
||||
// Success
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Delete a conversation specified by its [id]
|
||||
|
@ -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());
|
||||
|
Reference in New Issue
Block a user