feat : wearhouse home page

This commit is contained in:
2025-12-03 15:13:36 +03:30
parent 8c9517b529
commit c28a4a3177
35 changed files with 764 additions and 834 deletions

View File

@@ -74,7 +74,7 @@ class StewardRootLogic extends GetxController {
getProvinces();
}
if (inventoryModel.value == null) {
getInventory();
getRolesProduct();
}
if (rolesProductsModel.isEmpty) {
getRolesProducts();
@@ -100,7 +100,7 @@ class StewardRootLogic extends GetxController {
Future<void> onRefresh() async {
await Future.wait([
getInventory(),
getRolesProduct(),
getRolesProducts(),
getStewardSaleDashboard(),
getStewardRemainWeightData(),
@@ -117,13 +117,13 @@ class StewardRootLogic extends GetxController {
}
}
Future<void> getInventory() async {
Future<void> getRolesProduct() async {
// Cancel previous request if still running
_inventoryCancelToken?.cancel();
_inventoryCancelToken = CancelToken();
await safeCall<List<ProductModel>?>(
call: () async => await chickenRepository.getInventory(
call: () async => await chickenRepository.getRolesProduct(
token: tokenService.accessToken.value!,
cancelToken: _inventoryCancelToken,
role: 'Steward',
@@ -178,6 +178,7 @@ class StewardRootLogic extends GetxController {
safeCall(
call: () async => await chickenRepository.getRolesProducts(
token: tokenService.accessToken.value!,
queryParameters: buildQueryParams(role: 'Steward'),
),
onSuccess: (result) {
if (result != null) {