Skip to content

Commit

Permalink
Fix broken GET requests resulting in errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sudokoko committed Apr 16, 2023
1 parent 9dc017c commit dc80856
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PLRPC/Types/ApiRepositoryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private bool GetFromCache<T1, T2>(IReadOnlyDictionary<T1, (T2, long)> cache, T1
{
if (this.GetFromCache(this.userCache, username, out User? cachedUser)) return cachedUser;

string userJson = await this.httpClient.GetStringAsync($"username/{username}");
string userJson = await this.httpClient.GetStringAsync($"/api/v1/username/{username}");
User? user = JsonSerializer.Deserialize<User>(userJson);
if (user == null) return null;

Expand All @@ -47,7 +47,7 @@ private bool GetFromCache<T1, T2>(IReadOnlyDictionary<T1, (T2, long)> cache, T1
{
if (this.GetFromCache(this.userStatusCache, userId, out UserStatus? cachedUserStatus)) return cachedUserStatus;

string userStatusJson = await this.httpClient.GetStringAsync($"user/{userId}/status");
string userStatusJson = await this.httpClient.GetStringAsync($"/api/v1/user/{userId}/status");
UserStatus? userStatus = JsonSerializer.Deserialize<UserStatus>(userStatusJson);
if (userStatus == null) return null;

Expand All @@ -59,7 +59,7 @@ private bool GetFromCache<T1, T2>(IReadOnlyDictionary<T1, (T2, long)> cache, T1
{
if (this.GetFromCache(this.slotCache, slotId, out Slot? cachedSlot)) return cachedSlot;

string slotJson = await this.httpClient.GetStringAsync($"/slot/{slotId}");
string slotJson = await this.httpClient.GetStringAsync($"/api/v1/slot/{slotId}");

Slot? slot = JsonSerializer.Deserialize<Slot>(slotJson);
if (slot == null) return null;
Expand Down

0 comments on commit dc80856

Please sign in to comment.