diff --git a/backend/controllers/configurations.js b/backend/controllers/configurations.js
index 05a320c..2df9d06 100644
--- a/backend/controllers/configurations.js
+++ b/backend/controllers/configurations.js
@@ -220,9 +220,11 @@ configurationsRouter.delete(
const success = await db.Configuration.destroy({
where: { id: req.params.configurationId },
})
- success
- ? console.log(`Configuration ${req.params.configurationId} destroyed.`)
- : console.log('Nothing to delete.')
+ if (success) {
+ console.log(`Configuration ${req.params.configurationId} destroyed.`)
+ } else {
+ console.log('Nothing to delete.')
+ }
return res.status(204).end()
}
)
diff --git a/backend/controllers/email.js b/backend/controllers/email.js
index c24fdff..087c68b 100644
--- a/backend/controllers/email.js
+++ b/backend/controllers/email.js
@@ -242,7 +242,7 @@ emailRouter.get('/templates', checkAdmin, async (req, res) => {
const payload = templates.length > 0 ? templates[0] : defaultEmailTemplates
return res.json(serializeTemplatesByLanguage(payload))
- } catch (err) {
+ } catch {
res.status(500).json({ error: 'Something is wrong... try reloading the page' })
}
})
@@ -281,7 +281,7 @@ const parseTemplates = (req, res, next) => {
templates: deserialized
}
next()
- } catch (e) {
+ } catch {
res.status(500).json({ error: 'internal server error' })
}
}
@@ -311,7 +311,7 @@ emailRouter.post(
customer_review_link_eng
})
res.status(200).json(serializeTemplatesByLanguage(createdTemplates))
- } catch (e) {
+ } catch {
res.status(500).json({ error: 'Something is wrong... try reloading the page' })
}
}
diff --git a/backend/controllers/groups.js b/backend/controllers/groups.js
index 1c11a1c..019cffe 100644
--- a/backend/controllers/groups.js
+++ b/backend/controllers/groups.js
@@ -283,9 +283,11 @@ router.put('/:groupId', checkAdmin, async (req, res) => {
router.delete('/:groupId', checkAdmin, async (req, res) => {
const success = await db.Group.destroy({ where: { id: req.params.groupId } })
- success
- ? console.log(`Group ${req.params.groupId} destroyed.`)
- : console.log('Nothing to delete.')
+ if (success) {
+ console.log(`Group ${req.params.groupId} destroyed.`)
+ } else {
+ console.log('Nothing to delete.')
+ }
return res.status(204).end()
})
diff --git a/backend/controllers/instructorTimeLogs.js b/backend/controllers/instructorTimeLogs.js
index 1cc6326..1332105 100644
--- a/backend/controllers/instructorTimeLogs.js
+++ b/backend/controllers/instructorTimeLogs.js
@@ -75,7 +75,7 @@ instructorTimeLogsRouter.get('/', checkInstructor, async (req, res) => {
try {
const timeLogs = await fetchAllFromDb()
return res.status(200).json(timeLogs)
- } catch (error) {
+ } catch {
return res.status(500).json({ error: 'Error fetching time logs.' })
}
})
diff --git a/backend/controllers/timeLogs.js b/backend/controllers/timeLogs.js
index 62a5335..4d861b3 100644
--- a/backend/controllers/timeLogs.js
+++ b/backend/controllers/timeLogs.js
@@ -178,7 +178,7 @@ timeLogsRouter.get('/', checkLogin, async (req, res) => {
const user_id = req.user.id
const timeLogs = user_id ? await fetchFromDb(user_id) : []
return res.status(200).json(timeLogs)
- } catch (error) {
+ } catch {
return res.status(500).json({ error: 'Error fetching time logs.' })
}
})
diff --git a/backend/index.js b/backend/index.js
index 2489089..563af52 100644
--- a/backend/index.js
+++ b/backend/index.js
@@ -33,7 +33,7 @@ const shibbolethHeaders = [
app.use(cors())
app.use(bodyParser.json({ limit: '100mb' }))
app.use(headersMiddleware(shibbolethHeaders))
-isDevelopmentEnvironment() && app.use(fakeshibbo)
+if (isDevelopmentEnvironment()) app.use(fakeshibbo)
app.use(unless('/api/login', logger))
// Routers
diff --git a/frontend/.oxlintrc.json b/frontend/.oxlintrc.json
index 9a7d3f8..8c0fc98 100644
--- a/frontend/.oxlintrc.json
+++ b/frontend/.oxlintrc.json
@@ -16,5 +16,13 @@
"rules": {
"eqeqeq": "error",
"react-hooks/exhaustive-deps": "warn"
- }
+ },
+ "overrides": [
+ {
+ "files": ["src/components/RegistrationDetailsPage.jsx"],
+ "rules": {
+ "react/no-did-mount-set-state": "warn"
+ }
+ }
+ ]
}
\ No newline at end of file
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 32fe54c..d683d96 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -116,8 +116,8 @@ const App = (props) => {
const fetchData = async () => {
updateIsLoading(true)
- !isCustomerReviewPage && (await handleLogin())
- user && (await handleGroupInit())
+ if (!isCustomerReviewPage) await handleLogin()
+ if (user) await handleGroupInit()
await fetchRegistrationManagementData()
updateIsLoading(false)
}
diff --git a/frontend/src/components/AdminSprintsPage/AdminSprintsPage.jsx b/frontend/src/components/AdminSprintsPage/AdminSprintsPage.jsx
index 33575d1..524157e 100644
--- a/frontend/src/components/AdminSprintsPage/AdminSprintsPage.jsx
+++ b/frontend/src/components/AdminSprintsPage/AdminSprintsPage.jsx
@@ -97,7 +97,7 @@ const AdminSprintsPage = (props) => {
await fetchSprints(selectedGroupId)
setIsLoading(false)
}
- selectedGroup?.id && fetchData(selectedGroup.id)
+ if (selectedGroup?.id) fetchData(selectedGroup.id)
}, [selectedGroup, selectedConfiguration])
diff --git a/frontend/src/components/EmailTemplatesPage/EmailTemplatesPage.jsx b/frontend/src/components/EmailTemplatesPage/EmailTemplatesPage.jsx
index 132942c..43d3abc 100644
--- a/frontend/src/components/EmailTemplatesPage/EmailTemplatesPage.jsx
+++ b/frontend/src/components/EmailTemplatesPage/EmailTemplatesPage.jsx
@@ -27,7 +27,7 @@ class EmailTemplatesPage extends React.Component {
try {
await this.props.updateEmailTemplates(newTemplates)
this.props.setSuccess('Email templates saved!')
- } catch (e) {
+ } catch {
this.props.setError('Failed to update email templates')
}
}
diff --git a/frontend/src/components/GroupManagementPage/GroupManagementPage.jsx b/frontend/src/components/GroupManagementPage/GroupManagementPage.jsx
index 3c1f317..88f0feb 100644
--- a/frontend/src/components/GroupManagementPage/GroupManagementPage.jsx
+++ b/frontend/src/components/GroupManagementPage/GroupManagementPage.jsx
@@ -37,7 +37,7 @@ const GroupManagementPage = (props) => {
setUsers(fetchedUsers)
setGroups(fetchedGroups)
await fetchTopics()
- } catch (err) {
+ } catch {
setError('Some error happened')
}
}
diff --git a/frontend/src/components/InstructorReviewPage.jsx b/frontend/src/components/InstructorReviewPage.jsx
index 2468027..e26a42f 100644
--- a/frontend/src/components/InstructorReviewPage.jsx
+++ b/frontend/src/components/InstructorReviewPage.jsx
@@ -311,7 +311,7 @@ const Review = ({ student, updateAnswer, index }) => {
const Reviews = ({ answerSheet, updateAnswer }) => {
return answerSheet.map((student, index) => {
return (
-