customers

This commit is contained in:
2026-04-10 11:11:55 +02:00
parent 8d6e8647b1
commit 810d99626a
6 changed files with 427 additions and 1 deletions

View File

@@ -19,6 +19,20 @@ class CustomerRepository {
}
}
Future<CustomerModel> updateCustomer(CustomerModel customer) async {
try {
final response = await _client
.from('customer')
.update(customer.toJson())
.eq('id', customer.id!)
.select()
.single();
return CustomerModel.fromJson(response);
} catch (e) {
throw 'Errore durante la modifica del cliente: $e';
}
}
// Recupera tutti i clienti dell'azienda
Future<List<CustomerModel>> getCustomers(String companyId) async {
try {