Skip to content
Snippets Groups Projects
Commit 261f48a4 authored by esikkala's avatar esikkala
Browse files

Add more options for instance backend config

parent 0ab11bee
No related branches found
No related tags found
No related merge requests found
...@@ -225,7 +225,15 @@ export const getByURI = ({ ...@@ -225,7 +225,15 @@ export const getByURI = ({
} else { } else {
({ endpoint, langTag, langTagSecondary } = config) ({ endpoint, langTag, langTagSecondary } = config)
} }
const { properties, relatedInstances, noFilterForRelatedInstances = false } = config.instance const {
properties,
relatedInstances = '',
filterTarget = 'related__id',
noFilterForRelatedInstances = false,
resultMapper = makeObjectList,
resultMapperConfig = null,
postprocess = null
} = config.instance
let q = instanceQuery let q = instanceQuery
q = q.replace('<PROPERTIES>', properties) q = q.replace('<PROPERTIES>', properties)
q = q.replace('<RELATED_INSTANCES>', relatedInstances) q = q.replace('<RELATED_INSTANCES>', relatedInstances)
...@@ -237,7 +245,7 @@ export const getByURI = ({ ...@@ -237,7 +245,7 @@ export const getByURI = ({
resultClass: resultClass, resultClass: resultClass,
facetClass: facetClass, facetClass: facetClass,
constraints: constraints, constraints: constraints,
filterTarget: 'related__id', filterTarget,
facetID: null facetID: null
})) }))
} }
...@@ -252,7 +260,9 @@ export const getByURI = ({ ...@@ -252,7 +260,9 @@ export const getByURI = ({
query: endpoint.prefixes + q, query: endpoint.prefixes + q,
endpoint: endpoint.url, endpoint: endpoint.url,
useAuth: endpoint.useAuth, useAuth: endpoint.useAuth,
resultMapper: makeObjectList, resultMapper,
resultMapperConfig,
postprocess,
resultFormat resultFormat
}) })
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment