updateDormBedContract method
Future<(UResponse<UDormBedContractResponse> ?, UResponse?, String?)>
updateDormBedContract({
- required UDormBedContractUpdateParams p,
- required dynamic onOk()?,
- required dynamic onError()?,
- required dynamic onException(
- String e
Implementation
Future<(UResponse<UDormBedContractResponse>?, UResponse<dynamic>?, String?)> updateDormBedContract({
required UDormBedContractUpdateParams p,
required Function(UResponse<UDormBedContractResponse> r)? onOk,
required Function(UResponse<dynamic> e)? onError,
required Function(String e)? onException,
}) async {
(UResponse<UDormBedContractResponse>?, UResponse<dynamic>?, String?) result = (null, null, null);
await UHttpClient.send(
method: "POST",
endpoint: "${U.baseUrl}/Hotel/DormBedContract/Update",
body: p.toMap().add("apiKey", U.apiKey).add("token", ULocalStorage.getToken()).add("locale", ULocalStorage.getLocale()),
onSuccess: (Response r) {
final UResponse<UDormBedContractResponse> ok = UResponse<UDormBedContractResponse>.fromJson(r.body, (dynamic i) => UDormBedContractResponse.fromMap(i));
result = (ok, null, null);
onOk?.call(ok);
},
onError: (Response r) {
final UResponse<dynamic> err = UResponse<dynamic>.fromJson(r.body, (dynamic i) => i);
result = (null, err, null);
onError?.call(err);
},
onException: (String e) {
result = (null, null, e);
onException?.call(e);
},
);
return result;
}