feat : sale in the province

This commit is contained in:
MrM
2025-06-27 18:08:53 +03:30
parent 701e8e0fbe
commit 751d48c02e
13 changed files with 1542 additions and 1896 deletions

View File

@@ -10,7 +10,8 @@ import 'package:rasadyar_core/core.dart';
class OutOfProvinceLogic extends GetxController {
var rootLogic = Get.find<RootLogic>();
Rxn<AllocatedMadeModel> allocatedMadeModel = Rxn<AllocatedMadeModel>();
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
Rxn<List<AllocatedMadeModel>?>();
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
@@ -29,11 +30,16 @@ class OutOfProvinceLogic extends GetxController {
safeCall(
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
token: rootLogic.tokenService.accessToken.value!,
page: 1,
queryParameters: buildQueryParams(
page: 1,
pageSize: 20,
search: 'filter',
role: 'Steward',
),
),
onSuccess: (result) {
if (result != null) {
allocatedMadeModel.value = result;
allocatedMadeModel.value = result.results;
}
},
onError: (error, stacktrace) {},
@@ -73,8 +79,7 @@ class OutOfProvinceLogic extends GetxController {
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
token: rootLogic.tokenService.accessToken.value!,
allocationTokens:
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
[],
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
),
onSuccess: (result) {
getAllocatedMade();