Skip to content

Commit

Permalink
regex op de output van een automatische test om enkel de geteste best…
Browse files Browse the repository at this point in the history
…anden te zien
  • Loading branch information
Bendemeurichy committed May 19, 2024
1 parent 1a8eda5 commit b887f31
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions frontend/frontend/src/pages/submissionPage/SubmissionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,28 @@ export function SubmissionPage() {
)
setRestrictions(restrictions.data)

const submissionResponse = await instance.get(`indieningen/${submissionId}/`)
const submissionResponse = await instance.get(
`indieningen/${submissionId}/`
)
//Get the submission file
const newSubmission: Submission = submissionResponse.data
newSubmission.filename = submissionResponse.data.bestand.replace(
/^.*[\\/]/,
''
)
if (newSubmission.result !== 'No tests: OK') {
const regex = /Testing (.*):/g
const matches = newSubmission.result.match(regex)
if (matches !== null) {
matches.map((match) => {
match.replace(':', '\n')
return match
})
}
}
newSubmission.filename =
submissionResponse.data.bestand.replace(/^.*[\\/]/, '')
newSubmission.bestand = await instance
.get(`/indieningen/${submissionId}/indiening_bestand`, {
responseType: 'blob',
}).then((res) => {
})
.then((res) => {
let filename = 'indiening.zip'
if (newSubmission.filename) {
filename = newSubmission.filename
Expand Down

0 comments on commit b887f31

Please sign in to comment.