fixed reschtsvorm
This commit is contained in:
10
app.js
10
app.js
@@ -22,6 +22,7 @@ app.post("/sync-kbo-data/:kboStructuredIdUuid", async function (req, res) {
|
||||
const response = await fetch(wegwijsUrl);
|
||||
const data = await response.json();
|
||||
|
||||
|
||||
let wegwijsOvo = null;
|
||||
if (data.length) {
|
||||
// We got a match on the KBO, getting the associated OVO back
|
||||
@@ -62,7 +63,7 @@ app.post("/sync-kbo-data/:kboStructuredIdUuid", async function (req, res) {
|
||||
});
|
||||
|
||||
function getKboFields(data) {
|
||||
console.log(data);
|
||||
console.log(data.organisationClassifications);
|
||||
|
||||
let changeTime = data.changeTime;
|
||||
let organisationName = data.name;
|
||||
@@ -87,13 +88,16 @@ function getKboFields(data) {
|
||||
|
||||
let rechtsvorm = data.organisationClassifications
|
||||
?.filter((fields) => {
|
||||
console.log(fields);
|
||||
return (
|
||||
fields.organisationClassificationId ===
|
||||
"3c809ffd-f864-456f-8704-28c16528daa2"
|
||||
fields.organisationClassificationTypeId === "9bae7539-64fd-5759-743c-ad9dfa4143d4" ||
|
||||
fields.organisationClassificationTypeId === "1131205e-9212-435d-b4cd-b0d955d08bcf"
|
||||
);
|
||||
})
|
||||
.pop()?.organisationClassificationName;
|
||||
|
||||
console.log(rechtsvorm)
|
||||
|
||||
let phone = data.contacts
|
||||
?.filter((fields) => {
|
||||
return (
|
||||
|
||||
@@ -198,8 +198,6 @@ export async function createNewKboOrg(kboOrg ,kboNummer){
|
||||
const contactPointUuidId = uuid();
|
||||
const contactPointUri = `http://data.lblod.info/id/contact-punten/${contactPointUuidId}`;
|
||||
|
||||
|
||||
|
||||
let updateStr = `
|
||||
INSERT {
|
||||
GRAPH ?g {
|
||||
@@ -208,6 +206,7 @@ export async function createNewKboOrg(kboOrg ,kboNummer){
|
||||
<http://mu.semte.ch/vocabularies/core/uuid> ${sparqlEscapeString(contactPointUuidId)} ;
|
||||
<http://schema.org/email> ${sparqlEscapeString(kboOrg.email)} ;
|
||||
<http://schema.org/telephone> ${sparqlEscapeString(kboOrg.phone)} ;
|
||||
<http://schema.org/contactType> ${sparqlEscapeString("Kbocontact")} ;
|
||||
<http://xmlns.com/foaf/0.1/page> ${sparqlEscapeString(kboOrg.website)}.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user