let AI comment everything because well... yeah...
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
// * Shared methods for deleting main entries from the database
|
||||
// * Provides functionality for:
|
||||
// * - Deleting all entries of a specific type
|
||||
// * - Deleting a single entry by ID
|
||||
|
||||
import 'package:fforte/enums/databases.dart';
|
||||
import 'package:fforte/interfaces/i_db.dart';
|
||||
import 'package:fforte/methods/excursion_db_helper.dart';
|
||||
import 'package:fforte/methods/place_db_helper.dart';
|
||||
|
||||
/// Helper class for deleting main entries from the database
|
||||
class DeleteMainEntries {
|
||||
/// Delete all main entries of a specific type
|
||||
/// @param dbType The type of database (place/excursion)
|
||||
static Future<void> deleteAll(DatabasesEnum dbType) async {
|
||||
// Select appropriate database helper
|
||||
IDb? db;
|
||||
|
||||
if (dbType == DatabasesEnum.place) {
|
||||
@@ -15,7 +24,11 @@ class DeleteMainEntries {
|
||||
await db!.deleteAllMainEntries();
|
||||
}
|
||||
|
||||
/// Delete a single main entry by ID
|
||||
/// @param dbType The type of database (place/excursion)
|
||||
/// @param id ID of the entry to delete
|
||||
static Future<void> deleteSingle(DatabasesEnum dbType, int id) async {
|
||||
// Select appropriate database helper
|
||||
IDb? db;
|
||||
|
||||
if (dbType == DatabasesEnum.place) {
|
||||
|
||||
Reference in New Issue
Block a user