fix get thirdparty/backup

This commit is contained in:
Anton Suhorukov 2022-07-22 13:01:23 +03:00
parent 6ffa21a919
commit 7f7b636d9b
2 changed files with 5 additions and 5 deletions

View File

@ -1564,18 +1564,18 @@ public class FileStorageService<T> //: IFileStorageService
return new List<ThirdPartyParams>(resultList.ToList());
}
public Task<ThirdPartyParams> GetBackupThirdPartyAsync()
public Task<List<ThirdPartyParams>> GetBackupThirdPartyAsync()
{
var providerDao = GetProviderDao();
if (providerDao == null)
{
return null;
return Task.FromResult(new List<ThirdPartyParams>());
}
return InternalBackupGetThirdPartyAsync(providerDao);
}
private async Task<ThirdPartyParams> InternalBackupGetThirdPartyAsync(IProviderDao providerDao)
private async Task<List<ThirdPartyParams>> InternalBackupGetThirdPartyAsync(IProviderDao providerDao)
{
var providersInfo = await providerDao.GetProvidersInfoAsync(FolderType.ThirdpartyBackup).ToListAsync();
@ -1589,7 +1589,7 @@ public class FileStorageService<T> //: IFileStorageService
ProviderKey = r.ProviderKey
});
return resultList.SingleOrDefault();
return new List<ThirdPartyParams>(resultList.ToList());
}
public Task<List<FileEntry>> GetThirdPartyFolderAsync(int folderType = 0)

View File

@ -203,7 +203,7 @@ public class ThirdpartyController : ApiControllerBase
/// <short>Get third party list</short>
/// <returns>Connected providers</returns>
[HttpGet("thirdparty/backup")]
public async Task<ThirdPartyParams> GetBackupThirdPartyAccountAsync()
public async Task<IEnumerable<ThirdPartyParams>> GetBackupThirdPartyAccountAsync()
{
return await _fileStorageServiceThirdparty.GetBackupThirdPartyAsync();
}