fix : add cancel Token
This commit is contained in:
@@ -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});
|
||||
|
||||
|
||||
@@ -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'},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user