add INN registration field

This commit is contained in:
smanylov
2026-02-13 19:17:10 +07:00
parent 7aa29bd398
commit 1fec3b2584
9 changed files with 331 additions and 74 deletions
+33
View File
@@ -126,3 +126,36 @@ export async function getBuildData() {
return null;
}
}
export async function fetchINN(inn: string) {
try {
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
method: 'POST',
body: JSON.stringify({
version: 1,
msg_id: 30004,
message_body: {
inn: inn,
}
}),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
});
if (response.ok) {
const parsed = await response.json()
if (parsed?.message_code === 0) {
return parsed.message_body
} else {
return null
}
} else {
return null
}
} catch (error) {
return null
}
}