Commit 632d9f6f authored by Jörg Richter's avatar Jörg Richter

REST client: adapt 2 get-related-topics requests

See dmx-platform/dmx-platform#341
parent a55a9abc
Pipeline #9984 passed with stage
in 1 second
......@@ -49,21 +49,6 @@ export default {
)
},
/**
* @param filter
* Optional: 1-hop traversal filtering. An object with 4 properties (each one is optional):
* "assocTypeUri"
* "myRoleTypeUri"
* "othersRoleTypeUri"
* "othersTopicTypeUri"
* If not specified no filter is applied.
*/
getTopicRelatedTopics (topicId, filter) {
return http.get(`/core/topic/${topicId}/related_topics`, {params: _filter(filter)}).then(response =>
utils.instantiateMany(response.data, RelatedTopic)
)
},
queryTopics (typeUri, value) {
return http.get(`/core/topics/type/${typeUri}/query/${value}`).then(response =>
utils.instantiateMany(response.data, Topic)
......@@ -91,6 +76,23 @@ export default {
})
},
/**
* @param filter
* Optional: 1-hop traversal filtering. An object with 4 properties (each one is optional):
* "assocTypeUri"
* "myRoleTypeUri"
* "othersRoleTypeUri"
* "othersTopicTypeUri"
* If not specified no filter is applied.
*/
getTopicRelatedTopics (topicId, filter) {
return http.get(`/core/topic/${topicId}/related-topics`, {params: _filter(filter)}).then(response =>
utils.instantiateMany(response.data, RelatedTopic)
)
},
// TODO: add getTopicRelatedAssocs()
createTopic (topicModel) {
return http.post('/core/topic', topicModel).then(response => {
const topic = new Topic(response.data)
......@@ -134,11 +136,13 @@ export default {
* If not specified no filter is applied.
*/
getAssocRelatedTopics (assocId, filter) {
return http.get(`/core/association/${assocId}/related_topics`, {params: _filter(filter)}).then(response =>
return http.get(`/core/assoc/${assocId}/related-topics`, {params: _filter(filter)}).then(response =>
utils.instantiateMany(response.data, RelatedTopic)
)
},
// TODO: add getAssocRelatedAssocs()
createAssoc (assocModel) {
return http.post('/core/assoc', assocModel).then(response => {
const assoc = new Assoc(response.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment