mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 09:58:27 +03:00
adjusted put token by identifier to not have a response
This commit is contained in:
parent
35da8dd4ed
commit
a267bf9cf7
3 changed files with 6 additions and 8 deletions
|
@ -8,7 +8,7 @@ namespace Bit.App.Abstractions
|
|||
{
|
||||
public interface IDeviceApiRepository : IApiRepository<DeviceRequest, DeviceResponse, string>
|
||||
{
|
||||
Task<ApiResult<DeviceResponse>> PutTokenAsync(string identifier, DeviceTokenRequest request);
|
||||
Task<ApiResult> PutTokenAsync(string identifier, DeviceTokenRequest request);
|
||||
Task<ApiResult> PutClearTokenAsync(string identifier);
|
||||
}
|
||||
}
|
|
@ -16,11 +16,11 @@ namespace Bit.App.Repositories
|
|||
|
||||
protected override string ApiRoute => "devices";
|
||||
|
||||
public virtual async Task<ApiResult<DeviceResponse>> PutTokenAsync(string identifier, DeviceTokenRequest request)
|
||||
public virtual async Task<ApiResult> PutTokenAsync(string identifier, DeviceTokenRequest request)
|
||||
{
|
||||
if(!Connectivity.IsConnected)
|
||||
{
|
||||
return HandledNotConnected<DeviceResponse>();
|
||||
return HandledNotConnected();
|
||||
}
|
||||
|
||||
using(var client = new ApiHttpClient())
|
||||
|
@ -34,12 +34,10 @@ namespace Bit.App.Repositories
|
|||
var response = await client.SendAsync(requestMessage);
|
||||
if(!response.IsSuccessStatusCode)
|
||||
{
|
||||
return await HandleErrorAsync<DeviceResponse>(response);
|
||||
return await HandleErrorAsync(response);
|
||||
}
|
||||
|
||||
var responseContent = await response.Content.ReadAsStringAsync();
|
||||
var responseObj = JsonConvert.DeserializeObject<DeviceResponse>(responseContent);
|
||||
return ApiResult<DeviceResponse>.Success(responseObj, response.StatusCode);
|
||||
return ApiResult.Success(response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace Bit.App.Services
|
|||
}
|
||||
}
|
||||
|
||||
public async void OnUnregistered(DeviceType deviceType)
|
||||
public void OnUnregistered(DeviceType deviceType)
|
||||
{
|
||||
Debug.WriteLine("Push Notification - Device Unnregistered");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue