bla
This commit is contained in:
parent
b5244c8fa6
commit
c9f4d0f605
1 changed files with 4 additions and 4 deletions
8
index.js
8
index.js
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue