From 86b87118591259fddee0b9f8c0a25bc5ceca9adf Mon Sep 17 00:00:00 2001 From: Hiroyuki Date: Wed, 15 Dec 2021 20:34:36 -0400 Subject: [PATCH] fix: properly update approved SAAs on EDS --- src/commands/saa_approve.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands/saa_approve.ts b/src/commands/saa_approve.ts index 2cd5196..108b6a3 100644 --- a/src/commands/saa_approve.ts +++ b/src/commands/saa_approve.ts @@ -1,6 +1,7 @@ import { Message, TextChannel } from 'eris'; import { apply as Apply } from '.'; import { Client, Command, RichEmbed } from '../class'; +import axios from 'axios'; export default class SAA_Approve extends Command { public applyCommand: Apply; @@ -51,6 +52,12 @@ export default class SAA_Approve extends Command { const chan = await this.client.getDMChannel(saa.userID); chan.createMessage({ embed }).then(() => this.success(message.channel, 'SAA successfully processed.')).catch(() => this.error(message.channel, 'Unable to deliver decision to user.')); + await axios({ + method: 'PATCH', + url: `https://eds.libraryofcode.org/dec/${saa.applicationID}`, + params: { auth: this.client.config.internalKey }, + body: { status: true }, + }); await this.client.db.SAA.deleteOne({ _id: saa._id }).lean().exec(); } catch (err) { return this.client.util.handleError(err, message, this);