Skip to content

Commit

Permalink
fix(sanity): fixes bugs around achievements that were missed in previ…
Browse files Browse the repository at this point in the history
…ous commits
  • Loading branch information
KenEucker committed Jan 5, 2024
1 parent a1c99f3 commit 5227111
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions examples/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ const runTests = async (out = false) => {
await get10PlayersAsync("BikeTag", biketagDefaultInstance, out)
}

// if (false) {
if (bikeTagImgurInstance) {
if (false) {
// if (bikeTagImgurInstance) {
console.log(pretty("Imgur BikeTag Client Instantiated"), imgurInstanceOpts)
await getGameAsync("Imgur", bikeTagImgurInstance, out)
// await getTag1Async("Imgur", bikeTagImgurInstance, out)
Expand All @@ -202,16 +202,16 @@ const runTests = async (out = false) => {
// await get10PlayersAsync("Imgur", bikeTagImgurInstance, out)
}

if (false) {
// if (bikeTagSanityInstance) {
// if (false) {
if (bikeTagSanityInstance) {
console.log(pretty("Sanity BikeTag Client Instantiated"), sanityInstanceOpts)
// await getTag1Async("Sanity", bikeTagSanityInstance, out)
// await get10TagsAsync("Sanity", bikeTagSanityInstance, out)
await getGameAsync("Sanity", bikeTagSanityInstance, out)
// await getAllGamesAsync("Sanity", bikeTagSanityInstance, out)
await get10PlayersAsync("Sanity", bikeTagSanityInstance, out)
await get1PlayerAsync("Sanity", bikeTagSanityInstance, out)
// await get10AchievementsAsync("Sanity", bikeTagSanityInstance, out)
// await get10PlayersAsync("Sanity", bikeTagSanityInstance, out)
// await get1PlayerAsync("Sanity", bikeTagSanityInstance, out)
await get10AchievementsAsync("Sanity", bikeTagSanityInstance, out)
// await get10AmbassadorsAsync("Sanity", bikeTagSanityInstance, out)
// await get10SettingsAsync("Sanity", bikeTagSanityInstance, out)
// await get10AchievementsAsync("Sanity", bikeTagSanityInstance, out)
Expand Down
2 changes: 1 addition & 1 deletion src/common/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const createAchievementObject = (
name: achievementData.name ?? '',
key: achievementData.key ?? '',
value: achievementData.value ?? '',
group: achievementData.value ?? '',
group: achievementData.group ?? '',
} as Achievement
}
export const achievementDataFields = Object.keys(createAchievementObject())
3 changes: 2 additions & 1 deletion src/sanity/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
createAchievementObject,
ambassadorDataReferenceFields,
createAmbassadorObject,
achievementDataFields,
settingDataFields,
ambassadorDataFields,
gameDataAssetFields,
Expand Down Expand Up @@ -495,7 +496,7 @@ export function constructSanityFieldsQuery(
case DataTypes.achievement:
referenceFields = []
arrayFields = []
fields = fields.length ? fields : settingDataFields
fields = fields.length ? fields : achievementDataFields
break
}

Expand Down

0 comments on commit 5227111

Please sign in to comment.