buono
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flux/core/blocs/session/session_cubit.dart';
|
||||
import 'package:flux/core/enums_and_consts/consts.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart'; // Per estrarre gli store
|
||||
import '../models/provider_model.dart';
|
||||
@@ -32,7 +33,7 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
try {
|
||||
// 1. Scarichiamo tutti i negozi dell'azienda
|
||||
final storesResponse = await _client
|
||||
.from('store')
|
||||
.from(Tables.stores)
|
||||
.select('id, name')
|
||||
.eq('company_id', companyId);
|
||||
|
||||
@@ -41,7 +42,7 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
if (existingProvider != null && existingProvider.id != null) {
|
||||
// ... (Vecchio codice di recupero)
|
||||
final links = await _client
|
||||
.from('providers_in_stores')
|
||||
.from(Tables.providersInStores)
|
||||
.select('store_id')
|
||||
.eq('provider_id', existingProvider.id!);
|
||||
linkedStoreIds = (links as List)
|
||||
@@ -83,6 +84,7 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
String? fiscalCode,
|
||||
String? sdiCode,
|
||||
String? emailPec,
|
||||
String? Function()? colorHex,
|
||||
}) {
|
||||
emit(
|
||||
state.copyWith(
|
||||
@@ -93,6 +95,7 @@ class ProviderFormCubit extends Cubit<ProviderFormState> {
|
||||
fiscalCode: fiscalCode,
|
||||
sdiCode: sdiCode,
|
||||
emailPec: emailPec,
|
||||
colorHex: colorHex,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user