update. save => print
This commit is contained in:
@@ -102,7 +102,7 @@ class ProductsRemoteDataSourceImpl implements ProductsRemoteDataSource {
|
|||||||
// The API returns a list of stages for the product
|
// The API returns a list of stages for the product
|
||||||
final list = json as List;
|
final list = json as List;
|
||||||
if (list.isEmpty) {
|
if (list.isEmpty) {
|
||||||
throw const ServerException('Product stages not found');
|
throw const ServerException('Không tìm thấy sản phẩm');
|
||||||
}
|
}
|
||||||
// Parse all stages from the list
|
// Parse all stages from the list
|
||||||
return list
|
return list
|
||||||
|
|||||||
@@ -418,7 +418,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
Text(
|
||||||
'Error',
|
'Lỗi',
|
||||||
style: theme.textTheme.titleLarge?.copyWith(
|
style: theme.textTheme.titleLarge?.copyWith(
|
||||||
color: theme.colorScheme.error,
|
color: theme.colorScheme.error,
|
||||||
),
|
),
|
||||||
@@ -788,8 +788,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print before saving to API
|
|
||||||
await _printQuantities(stage);
|
|
||||||
|
|
||||||
// Show loading dialog
|
// Show loading dialog
|
||||||
showDialog(
|
showDialog(
|
||||||
@@ -863,6 +862,9 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Print before saving to API
|
||||||
|
await _printQuantities(stage);
|
||||||
|
|
||||||
// Refresh the product detail to show updated quantities
|
// Refresh the product detail to show updated quantities
|
||||||
await ref.read(productDetailProvider(_providerKey).notifier).refreshProductDetail(
|
await ref.read(productDetailProvider(_providerKey).notifier).refreshProductDetail(
|
||||||
widget.warehouseId,
|
widget.warehouseId,
|
||||||
|
|||||||
Reference in New Issue
Block a user