feat : new segment logic

This commit is contained in:
2025-07-21 09:32:29 +03:30
parent e3a808383e
commit d300133adf
4 changed files with 23 additions and 21 deletions

View File

@@ -174,10 +174,11 @@ class SegmentationLogic extends GetxController {
var res = true;
SegmentationModel segmentationModel = SegmentationModel(
productKey: selectedProduct.value?.key,
weight: int.tryParse(weightController.text.clearComma) ?? 0,
);
iLog(segmentationModel.toString());
if (saleType.value == 2) {
segmentationModel.copyWith(guildKey: selectedGuildModel.value?.key);
}
safeCall(
call: () async => await rootLogic.chickenRepository.createSegmentation(
token: rootLogic.tokenService.accessToken.value!,
@@ -193,16 +194,11 @@ class SegmentationLogic extends GetxController {
return res;
}
Future<void> getGuilds() async {
safeCall(
call: () async =>
await rootLogic.chickenRepository.getGuilds(
call: () async => await rootLogic.chickenRepository.getGuilds(
token: rootLogic.tokenService.accessToken.value!,
queryParameters: buildQueryParams(
queryParams: {'all': true},
role: 'Steward',
),
queryParameters: buildQueryParams(queryParams: {'all': true}, role: 'Steward'),
),
onSuccess: (result) {
if (result != null) {