From f5d988ed0ec3b98df7508e808be4fab09675af5e Mon Sep 17 00:00:00 2001 From: Adam Alton Date: Fri, 27 May 2022 14:22:02 +0100 Subject: [PATCH] chore: send list of storage quota violators to support@web3.storage, not admin@ (#1369) --- packages/cron/src/jobs/storage.js | 2 +- packages/cron/test/storage.spec.js | 6 +++--- packages/db/postgres/migrations/010-add-admin-user.sql | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cron/src/jobs/storage.js b/packages/cron/src/jobs/storage.js index 0cd5b5e46a..c8036b3e1d 100644 --- a/packages/cron/src/jobs/storage.js +++ b/packages/cron/src/jobs/storage.js @@ -63,7 +63,7 @@ export async function checkStorageUsed ({ db, emailService }) { if (users.length) { if (email.emailType === EMAIL_TYPE.User100PercentStorage) { - const adminUser = await db.getUserByEmail('admin@web3.storage') + const adminUser = await db.getUserByEmail('support@web3.storage') const toAdmin = { _id: adminUser._id, email: adminUser.email, diff --git a/packages/cron/test/storage.spec.js b/packages/cron/test/storage.spec.js index 4a8ebbc4a2..3267c03b81 100644 --- a/packages/cron/test/storage.spec.js +++ b/packages/cron/test/storage.spec.js @@ -28,7 +28,7 @@ describe('cron - check user storage quotas', () => { beforeEach(async () => { emailService = new EmailService({ db: dbClient, provider: EMAIL_PROVIDERS.dummy }) adminUser = await createUser(dbClient, { - email: 'admin@web3.storage', + email: 'support@web3.storage', name: 'Web3 Storage Admin' }) @@ -62,14 +62,14 @@ describe('cron - check user storage quotas', () => { assert.equal(emailService.provider.sendEmail.callCount, 4) // Admin email - emailService.provider.sendEmail.calledWith(EMAIL_TYPE.AdminStorageExceeded, 'admin@web3.storage') + emailService.provider.sendEmail.calledWith(EMAIL_TYPE.AdminStorageExceeded, 'support@web3.storage') // Users email emailService.provider.sendEmail.calledWith(EMAIL_TYPE.User75PercentStorage, 'test2@email.com') emailService.provider.sendEmail.calledWith(EMAIL_TYPE.User85PercentStorage, 'test3@email.com') emailService.provider.sendEmail.calledWith(EMAIL_TYPE.User100PercentStorage, 'test4@email.com') - const adminUser = await dbClient.getUserByEmail('admin@web3.storage') + const adminUser = await dbClient.getUserByEmail('support@web3.storage') assert.ok(adminUser, 'admin user found') const adminStorageExceeded = await dbClient.emailHasBeenSent({ userId: Number(adminUser._id), diff --git a/packages/db/postgres/migrations/010-add-admin-user.sql b/packages/db/postgres/migrations/010-add-admin-user.sql index 9f52694d46..54e2ed1c82 100644 --- a/packages/db/postgres/migrations/010-add-admin-user.sql +++ b/packages/db/postgres/migrations/010-add-admin-user.sql @@ -5,8 +5,8 @@ INSERT INTO public.user ( public_address ) VALUES ( - 'admin@web3.storage', + 'support@web3.storage', 'Web3 Storage Admin', 'Web3 Storage Admin', 'Web3 Storage Admin' -); \ No newline at end of file +);