Skip to content

Commit

Permalink
lintfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mluukkai committed Jun 11, 2024
1 parent 6fe16e5 commit 281a90f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ProgrammeLevelAnswers = () => {
const answers = useSelector(state => state.tempAnswers)
const year = 2024
const form = 7
const programmes = useSelector(({ studyProgrammes }) => studyProgrammes.data)

useEffect(() => {
document.title = `${t('overview')}`
Expand All @@ -23,6 +24,8 @@ const ProgrammeLevelAnswers = () => {
dispatch(getTempAnswersByFormAndYear(form, year))
}, [dispatch])

const programmeByKey = key => programmes.find(prog => prog.key === key)

return (
<div>
<div style={{ marginBottom: '2em' }}>
Expand All @@ -48,8 +51,11 @@ const ProgrammeLevelAnswers = () => {
<h3>{t('answers')}:</h3>
{questionAnswers.length > 0 ? (
questionAnswers.map(answer => (
<div key={answer.programme}>
{answer.programme}: {answer.data[`${question.id}_text`]}
<div key={answer.programme} style={{ marginBottom: 25 }}>
<div style={{ margin: 10, fontSize: 14, fontWeight: 'bold' }}>
{answer.programme} {programmeByKey(answer.programme).name[lang]}
</div>
<div style={{ margin: 10, paddingLeft: 10 }}>{answer.data[`${question.id}_text`]}</div>
</div>
))
) : (
Expand Down
7 changes: 6 additions & 1 deletion server/controllers/answersController.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ const getFacultyTempAnswersAfterDeadline = async (req, res) => {
const { form, year } = req.params
try {
const deadline = await db.deadline.findOne({ where: { form } })
if (deadline) return res.status(403).json({ error: 'Deadline is active, this should not be used' })

// TODO no idea what is the logic here so will exclude form 7 for now
if (deadline && Number(form) !== 7) {
return res.status(403).json({ error: 'Deadline is active, this should not be used' })
}

const data = await db.tempAnswer.findAll({
where: {
form,
Expand Down

0 comments on commit 281a90f

Please sign in to comment.