This commit is contained in:
asyncnomi 2023-01-04 00:13:37 +01:00
parent b5244c8fa6
commit c9f4d0f605

View file

@ -460,16 +460,16 @@ fastify.post('/sendTreasure', async (request, reply) => {
&& "activityUid" in content) {
let treasureUid = makeid(16);
if ("treasureUid" in content) {
let treasureExists = check(content, "activityUid", ActivityData)
let treasureExists = check(content, "treasureUid", TreasureData)
if (treasureExists.success) {
if (TreasureData[treasureUid].state != "Pending"
|| TreasureData[treasureUid].creator != content.uid) {
if (TreasureData[content.treasureUid].state != "Pending"
|| TreasureData[content.treasureUid].creator != content.uid) {
return {
success: false,
why: "You cannot edit already accepted or refused treasure request, or request form other people"
}
} else {
treasureUid = content.prankUid;
treasureUid = content.treasureUid;
}
} else {
return treasureExists;