Fixed issue with accessing user dashboards. Closes #1590

This commit is contained in:
Mike Cao 2022-10-25 15:48:49 -07:00
parent 46a18f2918
commit 8b64ef1a4e
8 changed files with 33 additions and 25 deletions

View file

@ -10,7 +10,7 @@ export default async (req, res) => {
if (req.method === 'GET') {
const { userId } = req.auth;
const websites = await getUserWebsites(userId);
const websites = await getUserWebsites({ userId });
const ids = websites.map(({ websiteUuid }) => websiteUuid);
const token = createToken({ websites: ids }, secret());
const data = await getRealtimeData(ids, subMinutes(new Date(), 30));