1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-25 12:05:59 +01:00

adjusted put token by identifier to not have a response

This commit is contained in:
Kyle Spearrin 2016-08-06 18:45:23 -04:00
parent 35da8dd4ed
commit a267bf9cf7
3 changed files with 6 additions and 8 deletions

View File

@ -8,7 +8,7 @@ namespace Bit.App.Abstractions
{ {
public interface IDeviceApiRepository : IApiRepository<DeviceRequest, DeviceResponse, string> 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); Task<ApiResult> PutClearTokenAsync(string identifier);
} }
} }

View File

@ -16,11 +16,11 @@ namespace Bit.App.Repositories
protected override string ApiRoute => "devices"; 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) if(!Connectivity.IsConnected)
{ {
return HandledNotConnected<DeviceResponse>(); return HandledNotConnected();
} }
using(var client = new ApiHttpClient()) using(var client = new ApiHttpClient())
@ -34,12 +34,10 @@ namespace Bit.App.Repositories
var response = await client.SendAsync(requestMessage); var response = await client.SendAsync(requestMessage);
if(!response.IsSuccessStatusCode) if(!response.IsSuccessStatusCode)
{ {
return await HandleErrorAsync<DeviceResponse>(response); return await HandleErrorAsync(response);
} }
var responseContent = await response.Content.ReadAsStringAsync(); return ApiResult.Success(response.StatusCode);
var responseObj = JsonConvert.DeserializeObject<DeviceResponse>(responseContent);
return ApiResult<DeviceResponse>.Success(responseObj, response.StatusCode);
} }
} }

View File

@ -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"); Debug.WriteLine("Push Notification - Device Unnregistered");
} }