mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 19:57:23 +01:00
implement RestoreThenUpload for charadata
This commit is contained in:
parent
5e4451fc9e
commit
1d9bb90976
3 changed files with 46 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using MareSynchronos.API.Data;
|
||||
using MareSynchronos.API.Dto.CharaData;
|
||||
using MareSynchronos.Services.CharaData.Models;
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
|
@ -70,6 +71,22 @@ public partial class ApiController
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<CharaDataFullDto?> CharaDataAttemptRestore(string id)
|
||||
{
|
||||
if (!IsConnected) return null;
|
||||
|
||||
try
|
||||
{
|
||||
Logger.LogDebug("Attempting to restore chara data {id}", id);
|
||||
return await _mareHub!.InvokeAsync<CharaDataFullDto?>(nameof(CharaDataAttemptRestore), id).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogWarning(ex, "Failed to restore chara data for {id}", id);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<CharaDataFullDto>> CharaDataGetOwn()
|
||||
{
|
||||
if (!IsConnected) return [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue