Merge branch 'dev' of https://gitlab.libraryofcode.org/engineering/community-relations/backend into dev
commit
75aa1d3b63
|
@ -1,6 +1,7 @@
|
||||||
import { Message, TextChannel } from 'eris';
|
import { Message, TextChannel } from 'eris';
|
||||||
import { apply as Apply } from '.';
|
import { apply as Apply } from '.';
|
||||||
import { Client, Command, RichEmbed } from '../class';
|
import { Client, Command, RichEmbed } from '../class';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
export default class SAA_Approve extends Command {
|
export default class SAA_Approve extends Command {
|
||||||
public applyCommand: Apply;
|
public applyCommand: Apply;
|
||||||
|
@ -51,6 +52,12 @@ export default class SAA_Approve extends Command {
|
||||||
const chan = await this.client.getDMChannel(saa.userID);
|
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.'));
|
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();
|
await this.client.db.SAA.deleteOne({ _id: saa._id }).lean().exec();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return this.client.util.handleError(err, message, this);
|
return this.client.util.handleError(err, message, this);
|
||||||
|
|
Loading…
Reference in New Issue