fix : add cancel Token

This commit is contained in:
2025-06-23 10:42:29 +03:30
parent ec0e344e47
commit 1e3614ed58
10 changed files with 140 additions and 88 deletions

View File

@@ -19,7 +19,7 @@ import '../models/request/create_steward_free_bar/create_steward_free_bar.dart';
abstract class ChickenRepository {
Future<List<InventoryModel>?> getInventory({required String token});
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({required String token});
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({required String token});
Future<BarInformation?> getGeneralBarInformation({required String token, Map<String, dynamic>? queryParameters});

View File

@@ -35,7 +35,7 @@ class ChickenRepositoryImpl implements ChickenRepository {
}
@override
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({required String token}) async {
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({required String token}) async {
var res = await _httpClient.get(
'/kill-house-distribution-info/?role=Steward',
headers: {'Authorization': 'Bearer $token'},

View File

@@ -72,7 +72,7 @@ class HomeLogic extends GetxController {
Future<void> getDistributionInformation() async {
await safeCall<KillHouseDistributionInfo?>(
call: () async => await rootLogic.chickenRepository.getIKillHouseDistributionInfo(token: rootLogic.tokenService.accessToken.value!),
call: () async => await rootLogic.chickenRepository.getKillHouseDistributionInfo(token: rootLogic.tokenService.accessToken.value!),
onSuccess: (result) {
if (result != null) {
killHouseDistributionInfo.value = result;