implement RestoreThenUpload for charadata
This commit is contained in:
@@ -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 [];
|
||||
|
||||
Reference in New Issue
Block a user