Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Delete FCM token from KV on appeal action
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent e2d1739 commit 53b05e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions/api/appeals/[id]/accept.ts
Expand Up @@ -37,6 +37,7 @@ export async function onRequestPost(context: RequestContext) {
.bind(context.params.id)
.run();

delete appeal.fcm_token;
delete appeal.user.email;

await context.env.DATA.put(`appeal_${appeal.id}`, JSON.stringify(appeal), {
Expand Down
3 changes: 3 additions & 0 deletions functions/api/appeals/[id]/deny.ts
Expand Up @@ -38,6 +38,9 @@ export async function onRequestPost(context: RequestContext) {

const { current_user: currentUser } = context.data;

delete appeal.user.email;
delete appeal.fcm_token;

await fetch(context.env.APPEALS_WEBHOOK, {
body: JSON.stringify({
embeds: [
Expand Down

0 comments on commit 53b05e2

Please sign in to comment.