Improves apiclient internal code

This commit is contained in:
Serraniel 2023-03-01 19:10:16 +01:00
parent 80219867df
commit e6c7cdf9b4
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -77,9 +77,7 @@ public class ApiClient
private string SetQuery(string? filter) private string SetQuery(string? filter)
{ {
var result = "set"; return !string.IsNullOrEmpty(filter) ? $"set/{filter.TrimStart('/')}" : "set";
return !string.IsNullOrEmpty(filter) ? $"{result}/{filter.TrimStart('/')}" : result;
} }
public async Task<IEnumerable<Set>> FetchSetsAsync() public async Task<IEnumerable<Set>> FetchSetsAsync()
@ -94,7 +92,7 @@ public class ApiClient
public async Task<Set?> FetchSetByUuid(int uuid) public async Task<Set?> FetchSetByUuid(int uuid)
{ {
return await FetchInternalAsync<Set>(SetQuery("uuid/" + uuid)); return await FetchInternalAsync<Set>(SetQuery($"uuid/{uuid}"));
} }
/* /*