mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: disable dompurify for non string & number types
This commit is contained in:
parent
13bfa5767b
commit
2d6cda1aef
1 changed files with 3 additions and 2 deletions
|
|
@ -85,8 +85,9 @@ export const apiLogin = async (data: CandidateLogin): Promise<number> => {
|
|||
export const apiFillDetails = async (data: CandidateData): Promise<CandidateData> => {
|
||||
// Sanitize candidate data
|
||||
Object.keys(data.candidate).forEach((key) => {
|
||||
// TODO: Enable DOMPurify onyl on string & number types
|
||||
if (key === "grades") return;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
if (typeof data.candidate[key] !== 'string' && typeof data.candidate[key] !== 'number') return;
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
data.candidate[key] = DOMPurify.sanitize(data.candidate[key]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue