reworked operation (#12)
Reviewed-on: #12 Co-authored-by: Mark M2 Macbook <marco@catelli.it> Co-committed-by: Mark M2 Macbook <marco@catelli.it>
This commit is contained in:
@@ -24,7 +24,7 @@ class CoreRepository {
|
||||
return CompanyModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Errore recupero azienda: $e');
|
||||
throw Exception('Errore recupero azienda: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class CoreRepository {
|
||||
if (response == null) return null;
|
||||
return CompanyModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Errore recupero azienda per ID: $e');
|
||||
debugPrint('$e');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -50,12 +50,12 @@ class CoreRepository {
|
||||
.select()
|
||||
.eq('company_id', companyId)
|
||||
.eq('is_active', true) // Buona pratica
|
||||
.order('nome'); // O come si chiama il campo nome
|
||||
.order('name'); // O come si chiama il campo nome
|
||||
|
||||
return (response as List).map((s) => StoreModel.fromMap(s)).toList();
|
||||
} catch (e) {
|
||||
debugPrint('Errore recupero negozi: $e');
|
||||
throw Exception('Errore recupero negozi: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class CoreRepository {
|
||||
return StaffMemberModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Errore recupero profilo staff: $e');
|
||||
throw Exception('Errore recupero profilo staff: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class CoreRepository {
|
||||
return CompanyModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Creazione azienda fallita: $e');
|
||||
throw Exception('Creazione azienda fallita: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class CoreRepository {
|
||||
return StoreModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Creazione negozio fallita: $e');
|
||||
throw Exception('Creazione negozio fallita: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ class CoreRepository {
|
||||
return StaffMemberModel.fromMap(response);
|
||||
} catch (e) {
|
||||
debugPrint('Creazione profilo staff fallita: $e');
|
||||
throw Exception('Creazione profilo staff fallita: $e');
|
||||
throw Exception('$e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user