Skip to content

Commit

Permalink
Cert check (#3218)
Browse files Browse the repository at this point in the history
* Проверка ОГРН

* Проверка ОГРН reversed
  • Loading branch information
mikhailprivalov authored Nov 16, 2023
1 parent ec74511 commit 0a0b892
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion l2-frontend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,13 @@ export const convertSubjectNameToTitle = (object: any, subjectName: string | nul
export const subjectNameHasOGRN = (object: any, subjectName: string | null) => {
const obj = object || convertSubjectNameToCertObject(subjectName);

return String(obj['ОГРН'] || '').length === 13;
let ogrn = obj['ОГРН'] || null;

if (!ogrn) {
ogrn = Object.entries(obj).find(([, v]) => v === 'ОГРН')?.[0] || null;
}

return String(ogrn || '').length === 13;
};

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

0 comments on commit 0a0b892

Please sign in to comment.