|
|
|
@ -62,7 +62,6 @@ class MarathonApiClient {
|
|
|
|
|
|
|
|
|
|
|
|
Future<MarathonDetailModel> getMarathonDetails() async {
|
|
|
|
Future<MarathonDetailModel> getMarathonDetails() async {
|
|
|
|
String payrollString = AppState().postParamsObject?.payrollCodeStr.toString() ?? "CS";
|
|
|
|
String payrollString = AppState().postParamsObject?.payrollCodeStr.toString() ?? "CS";
|
|
|
|
|
|
|
|
|
|
|
|
Response response = await ApiClient().getJsonForResponse(
|
|
|
|
Response response = await ApiClient().getJsonForResponse(
|
|
|
|
ApiConsts.marathonUpcomingUrl + payrollString,
|
|
|
|
ApiConsts.marathonUpcomingUrl + payrollString,
|
|
|
|
token: AppState().getMarathonToken == null || AppState().getMarathonToken == "" ? await getMarathonToken() : AppState().getMarathonToken,
|
|
|
|
token: AppState().getMarathonToken == null || AppState().getMarathonToken == "" ? await getMarathonToken() : AppState().getMarathonToken,
|
|
|
|
@ -84,7 +83,7 @@ class MarathonApiClient {
|
|
|
|
return marathonDetailModel;
|
|
|
|
return marathonDetailModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<int?> joinMarathonAsParticipant() async {
|
|
|
|
Future<MarathonGenericModel> joinMarathonAsParticipant() async {
|
|
|
|
Map<String, String> jsonObject = <String, String>{
|
|
|
|
Map<String, String> jsonObject = <String, String>{
|
|
|
|
"employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER ?? "",
|
|
|
|
"employeeNumber": AppState().memberInformationList!.eMPLOYEENUMBER ?? "",
|
|
|
|
"employeeNameAr": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "",
|
|
|
|
"employeeNameAr": AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEAr ?? AppState().memberInformationList!.eMPLOYEEDISPLAYNAMEEn ?? "",
|
|
|
|
@ -95,7 +94,7 @@ class MarathonApiClient {
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
return await ApiClient().postJsonForObject(
|
|
|
|
(json) {
|
|
|
|
(json) {
|
|
|
|
MarathonGenericModel marathonModel = MarathonGenericModel.fromJson(json);
|
|
|
|
MarathonGenericModel marathonModel = MarathonGenericModel.fromJson(json);
|
|
|
|
return marathonModel.data["remainingTime"];
|
|
|
|
return marathonModel;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
ApiConsts.marathonJoinParticipantUrl,
|
|
|
|
ApiConsts.marathonJoinParticipantUrl,
|
|
|
|
jsonObject,
|
|
|
|
jsonObject,
|
|
|
|
|