latest store services
This commit is contained in:
@@ -84,6 +84,22 @@ class ServicesRepository {
|
||||
}
|
||||
}
|
||||
|
||||
Stream<List<ServiceModel>> getLastStoreServicesStream({
|
||||
required String storeId,
|
||||
required int limit,
|
||||
}) {
|
||||
return _supabase
|
||||
.from('service')
|
||||
.stream(primaryKey: ['id'])
|
||||
.eq('store_id', storeId)
|
||||
.order('created_at', ascending: false)
|
||||
.limit(limit)
|
||||
.map(
|
||||
(listOfMaps) =>
|
||||
listOfMaps.map((map) => ServiceModel.fromMap(map)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
// --- SALVATAGGIO COMPLETO (PRIMA PADRE, POI FIGLI) ---
|
||||
Future<ServiceModel> saveFullService(ServiceModel service) async {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user