Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix вывода данных о сертификатах #3067

Merged
merged 4 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions l2-frontend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,31 +361,14 @@
return result;
};

export const convertSubjectNameToTitle = (object: any, subjectName: string | null, name: string) => {

Check warning on line 364 in l2-frontend/src/utils.ts

View workflow job for this annotation

GitHub Actions / webpack_build_prod

'name' is defined but never used

Check warning on line 364 in l2-frontend/src/utils.ts

View workflow job for this annotation

GitHub Actions / webpack_build_prod

'name' is defined but never used
const obj = object || convertSubjectNameToCertObject(subjectName);

// eslint-disable-next-line no-console
console.log(obj);
// eslint-disable-next-line no-console
console.log(subjectName);

if (!obj.SNILS && obj['СНИЛС']) {
obj.SNILS = obj['СНИЛС'];
}

let result = `НЕТ СНИЛС ${name}`;
if (obj.CN) {
if (obj.T && obj.SN && obj.G) {
let CN = obj.CN.replace('"""', '""');

if (CN.length > 1 && CN[0] === '"' && CN[CN.length - 1] === '"') {
CN = CN.slice(1, -1);
}
CN = CN.replace('""', '"');
result = `${!obj.SNILS ? 'НЕТ СНИЛС ' : ''}${obj.SN} ${obj.G}${obj.SNILS ? `, ${obj.SNILS}` : ''} — ${obj.T} — ${CN}`;
}
}
return result;
return [obj.SN, obj.G, obj.SNILS, obj.T].filter(Boolean).join(' ');
};

export const validateEmail = (email: string) => Boolean(
Expand Down