LAST COMMIT AS FAR AS I'M CONCERNED

This commit is contained in:
asyncnomi 2023-01-04 00:43:59 +01:00
parent 3d12c9e573
commit c960f961ce

View file

@ -318,7 +318,7 @@ fastify.post('/get', async (request, reply) => {
case "treasure":
let treasureData = JSON.parse(JSON.stringify(TreasureData));
for (treasure in treasureData) {
treasureData[treasure].activity = ActivityData[treasureData[treasure].activity];
treasureData[treasure].activity = ActivityData[treasureData[treasure].activityUid];
}
if (AdminUsersUid.includes(content.uid)) {
return {
@ -493,7 +493,7 @@ fastify.post('/sendTreasure', async (request, reply) => {
creator: content.uid,
image: imageUid,
desc: content.desc,
activity: content.activityUid,
activityUid: content.activityUid,
state: "Pending"
}
saveData(treasurePath, TreasureData);
@ -558,8 +558,6 @@ fastify.post('/acceptTreasure', async (request, reply) => {
if (treasureExists.success) {
TreasureData[content.treasureUid].state = "Accepted";
saveData(treasurePath, TreasureData);
console.log(TreasureData[content.treasureUid])
console.log(ActivityData[TreasureData[content.treasureUid].activityUid])
ActivityData[TreasureData[content.treasureUid].activityUid].treasureState = "Accepted";
saveData(activityPath, ActivityData);
GoldenUsers[TreasureData[content.treasureUid].activityUid] = {