fixed saveFile
time time this time for real
This commit is contained in:
@@ -48,21 +48,21 @@ class ExcursionDBHelper implements IDb {
|
||||
@override
|
||||
Future<int> addMainEntry(Map<String, String> excursion) async {
|
||||
var excursionDBClient = await dB;
|
||||
final existingID = await excursionDBClient.query(
|
||||
'excursion',
|
||||
where: 'ID = ?',
|
||||
whereArgs: [excursion['ID']],
|
||||
);
|
||||
// final existingID = await excursionDBClient.query(
|
||||
// 'excursion',
|
||||
// where: 'ID = ?',
|
||||
// whereArgs: [excursion['ID']],
|
||||
// );
|
||||
|
||||
if (existingID.isNotEmpty) {
|
||||
updateMainEntry(excursion);
|
||||
return existingID.first['ID'] as int; // Return existing ID
|
||||
}
|
||||
// if (existingID.isNotEmpty) {
|
||||
// updateMainEntry(excursion);
|
||||
// return existingID.first['ID'] as int; // Return existing ID
|
||||
// }
|
||||
|
||||
int id = await excursionDBClient.insert(
|
||||
'excursion',
|
||||
excursion,
|
||||
//conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
|
||||
return id; // Return the ID of the newly inserted entry
|
||||
|
||||
Reference in New Issue
Block a user