Settings Cache Refactor

This commit is contained in:
Wyatt Johnson
2018-05-07 14:27:00 -06:00
parent 7aa31b7cb2
commit 2b1108cd88
27 changed files with 209 additions and 260 deletions
@@ -36,10 +36,10 @@ module.exports = connectors => {
const {
organizationName,
organizationContactEmail,
} = await Settings.load([
} = await Settings.select(
'organizationName',
'organizationContactEmail',
]);
'organizationContactEmail'
);
// rescheduledDeletionDate is the date in the future that we'll set the
// user's account to be deleted on if this delete fails.
@@ -81,7 +81,7 @@ async function sendDownloadLink(ctx) {
// Generate the download links.
const { downloadLandingURL } = await generateDownloadLinks(ctx, user.id);
const { organizationName } = await Settings.load('organizationName');
const { organizationName } = await Settings.select('organizationName');
// Send the download link via the user's attached email account.
await Users.sendEmail(user, {
@@ -130,7 +130,7 @@ async function requestDeletion({
}
);
const { organizationName } = await Settings.load('organizationName');
const { organizationName } = await Settings.select('organizationName');
// Send the download link via the user's attached email account.
await Users.sendEmail(user, {
@@ -171,7 +171,7 @@ async function cancelDeletion({
{ $unset: { 'metadata.scheduledDeletionDate': 1 } }
);
const { organizationName } = await Settings.load('organizationName');
const { organizationName } = await Settings.select('organizationName');
// Send the download link via the user's attached email account.
await Users.sendEmail(user, {