Skip to content

Commit

Permalink
fix skyblock/profiles endpoint returning empty object when uncached o…
Browse files Browse the repository at this point in the history
…n graphql (slothpixel#703)
  • Loading branch information
ImRodry authored and ChristianDobbie committed Jan 10, 2022
1 parent d5aa338 commit 4a33a62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const buildBoosters = require('../store/buildBoosters');
const buildCounts = require('../store/buildCounts');
const buildPlayerStatus = require('../store/buildPlayerStatus');
const { getAuctions, queryAuctionId } = require('../store/queryAuctions');
const { buildProfile } = require('../store/buildSkyBlockProfiles');
const { buildProfileList, buildProfile } = require('../store/buildSkyBlockProfiles');
const { buildSkyblockCalendar, buildSkyblockEvents } = require('../store/buildSkyblockCalendar');
const buildGuild = require('../store/buildGuild');
const leaderboards = require('../store/leaderboards');
Expand Down Expand Up @@ -112,7 +112,7 @@ class SkyblockResolver {
async profiles({ player_name }) {
const uuid = await getUUID(player_name);
const profiles = await redis.get(`skyblock_profiles:${uuid}`);
return profiles ? JSON.parse(profiles) : {};
return profiles ? JSON.parse(profiles) : buildProfileList(uuid);
}

async profile({ player_name, profile_id }) {
Expand Down

0 comments on commit 4a33a62

Please sign in to comment.