chore: remove deprecated old routes for user data exports [breaking]

This commit is contained in:
Julian Lam
2022-09-20 13:56:53 -04:00
parent a6f8ff440a
commit 1d63fc469a
8 changed files with 37 additions and 139 deletions

View File

@@ -459,11 +459,10 @@ usersAPI.generateExport = async (caller, { uid, type }) => {
});
child.on('exit', async () => {
await db.deleteObjectField('locks', `export:${uid}${type}`);
const userData = await user.getUserFields(uid, ['username', 'userslug']);
const { displayname } = userData;
const { displayname } = await user.getUserFields(uid, ['username']);
const n = await notifications.create({
bodyShort: `[[notifications:${type}-exported, ${displayname}]]`,
path: `/api/user/${userData.userslug}/export/${type}`,
path: `/api/v3/users/${uid}/exports/${type}`,
nid: `${type}:export:${uid}`,
from: uid,
});