mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
@@ -297,6 +297,15 @@ class AppDatabase extends _$AppDatabase {
|
||||
|
||||
return totals;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// ACCOUNTS
|
||||
// ============================================================================
|
||||
|
||||
/// Update an account
|
||||
Future<void> updateAccount(AccountsCompanion account) async {
|
||||
await update(accounts).replace(account);
|
||||
}
|
||||
}
|
||||
|
||||
LazyDatabase _openConnection() {
|
||||
|
||||
@@ -160,4 +160,15 @@ class AccountRepository {
|
||||
createdAt: DateTime.now(),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> update(model.Account account) async {
|
||||
await _db.updateAccount(AccountsCompanion(
|
||||
id: Value(account.id),
|
||||
name: Value(account.name),
|
||||
isMain: Value(account.isMain),
|
||||
sortOrder: Value(account.sortOrder),
|
||||
currency: Value(account.currency),
|
||||
createdAt: Value(account.createdAt),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user