mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: sanitize grades too
This commit is contained in:
parent
b6f4a66e5f
commit
236e8f6386
1 changed files with 8 additions and 1 deletions
|
|
@ -3,7 +3,6 @@ import type {
|
|||
BaseCandidate,
|
||||
CandidateData,
|
||||
CandidateLogin,
|
||||
CreateCandidate
|
||||
} from '$lib/stores/candidate';
|
||||
import type { SubmissionProgress } from '$lib/stores/portfolio';
|
||||
import { API_URL, errorHandler, type Fetch } from '.';
|
||||
|
|
@ -92,6 +91,14 @@ export const apiFillDetails = async (data: CandidateData): Promise<CandidateData
|
|||
// @ts-ignore
|
||||
data.candidate[key] = DOMPurify.sanitize(data.candidate[key]);
|
||||
});
|
||||
// Sanitize grades data
|
||||
for (let index = 0; index < data.candidate.grades.length; index++) {
|
||||
Object.keys(data.candidate.grades[index]).forEach((key) => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
data.candidate.grades[index][key] = DOMPurify.sanitize(data.candidate.grades[index][key]);
|
||||
});
|
||||
}
|
||||
// Sanitize parents data
|
||||
for (let index = 0; index < data.parents.length; index++) {
|
||||
Object.keys(data.parents[index]).forEach((key) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue