Update InvokeRecActionAsync to return success status
The method `InvokeRecActionAsync` in the `ReC.Client` namespace was updated to return a `bool` instead of `Task`. This change allows the method to indicate whether the HTTP request was successful. - Updated the return type from `Task` to `Task<bool>`. - Modified the `<returns>` XML documentation to reflect the new behavior. - Replaced `resp.EnsureSuccessStatusCode()` with `resp.IsSuccessStatusCode` to return the success status directly.
This commit is contained in:
parent
4a1b221478
commit
b190e4f5e9
@ -24,11 +24,11 @@ namespace ReC.Client
|
||||
/// </summary>
|
||||
/// <param name="profileId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task InvokeRecActionAsync(int profileId, CancellationToken cancellationToken = default)
|
||||
/// <returns>True if the request was successful, false otherwise</returns>
|
||||
public async Task<bool> InvokeRecActionAsync(int profileId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var resp = await _http.PostAsync($"api/RecAction/invoke/{profileId}", content: null, cancellationToken);
|
||||
resp.EnsureSuccessStatusCode();
|
||||
return resp.IsSuccessStatusCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user