22 lines
572 B
Dart
22 lines
572 B
Dart
import 'package:fforte/methods/place_db_helper.dart';
|
|
|
|
class SaveMainEntryMethod {
|
|
static void saveEntry(
|
|
{required Map<String, dynamic> entryData,
|
|
required bool isTemplate,
|
|
bool sent = false}) async {
|
|
var placeDB = PlaceDBHelper();
|
|
|
|
// Get the ID of the newly added or updated place
|
|
int newPlaceId = await placeDB.addMainEntry(entryData);
|
|
|
|
if (sent == true) {
|
|
placeDB.updateSent(newPlaceId); // Update 'Sent' using the correct ID
|
|
}
|
|
|
|
if (isTemplate) {
|
|
await placeDB.deleteTemplateById(entryData["CID"]);
|
|
}
|
|
}
|
|
}
|