Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasambry committed Nov 19, 2024
1 parent 0bbc3d1 commit 5884399
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const BUILD_VERSION = process.env.BUILD_VERSION;
// eslint-disable-next-line no-undef
module.exports = withTM({
env: {
// eslint-disable-next-line no-undef
ARCHIVE_MODE: process.env.ARCHIVE_MODE || 'false',
},
distDir: './dist/next',
Expand Down
6 changes: 3 additions & 3 deletions server/controllers/analytic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ analyticController.router.post(
// Retrieve current user session or save the new one.
// eslint-disable-next-line prefer-const
let [sessionCount, userPhase] = await Promise.all([
AppDataSource.getRepository(AnalyticSession).count({where: {id: data.sessionId}}),
AppDataSource.getRepository(User).createQueryBuilder('user').select('user.firstlogin').where({id: data.userId}).getRawOne(),
AppDataSource.getRepository(AnalyticSession).count({ where: { id: data.sessionId } }),
AppDataSource.getRepository(User).createQueryBuilder('user').select('user.firstlogin').where({ id: data.userId }).getRawOne(),
]);

if (sessionCount === 0 && data.event === 'pageview' && data.params?.isInitial) {
Expand Down Expand Up @@ -331,7 +331,7 @@ analyticController.router.post(
pagePerf.data = data.params.perf as BrowserPerf;
AppDataSource.getRepository(AnalyticPerformance).save(pagePerf).catch(); // no need to wait
} else if (data.event === 'session' && data.params?.duration) {
AppDataSource.getRepository(AnalyticSession).update({id: data.sessionId}, {duration: data.params?.duration}).catch(); // no need to wait
AppDataSource.getRepository(AnalyticSession).update({ id: data.sessionId }, { duration: data.params?.duration }).catch(); // no need to wait
}
} catch (e) {
logger.error(e);
Expand Down
8 changes: 4 additions & 4 deletions server/h5p/get-h5p-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,14 @@ export const getH5pRouter = async () => {
res.status(400).send('Malformed request');
return;
}
const {id: contentId, metadata} = await h5pEditor.saveOrUpdateContentReturnMetaData(
const { id: contentId, metadata } = await h5pEditor.saveOrUpdateContentReturnMetaData(
undefined as unknown as string,
req.body.params.params,
req.body.params.metadata,
req.body.library,
req.user as unknown as H5pUser,
);
res.status(200).json({contentId, metadata});
res.status(200).json({ contentId, metadata });
}),
);

Expand All @@ -238,14 +238,14 @@ export const getH5pRouter = async () => {
res.status(400).send('Malformed request');
return;
}
const {id: contentId, metadata} = await h5pEditor.saveOrUpdateContentReturnMetaData(
const { id: contentId, metadata } = await h5pEditor.saveOrUpdateContentReturnMetaData(
req.params.contentId,
req.body.params.params,
req.body.params.metadata,
req.body.library,
req.user as unknown as H5pUser,
);
res.status(200).sendJSON({contentId, metadata});
res.status(200).sendJSON({ contentId, metadata });
}),
);

Expand Down
2 changes: 1 addition & 1 deletion server/middlewares/authenticate.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NextFunction, Request, RequestHandler, Response } from 'express';
import type { NextFunction, Request, Response } from 'express';
import jwt from 'jsonwebtoken';

import { getNewAccessToken } from '../authentication/lib/tokens';
Expand Down

0 comments on commit 5884399

Please sign in to comment.