Skip to content

Commit

Permalink
Update webhook update
Browse files Browse the repository at this point in the history
  • Loading branch information
soruly committed Dec 8, 2023
1 parent c26627a commit 054a74f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/webhook/patreon.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ export default async (req, res) => {
await knex("user").where("email", email).update({ tier });
}
}
} else if (patron_status === "declined_patron") {
await knex("user").where("email", email).update({ tier: 0 });
} else if (email && patron_status === "declined_patron") {
const rows = await knex("user").select("*").where("email", email).limit(1);
if (rows.length) {
await knex("user").where("email", email).update({ tier: 0 });
}
}

res.json({});
Expand Down

0 comments on commit 054a74f

Please sign in to comment.