diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-04-26 23:46:51 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-04-26 23:46:51 +1000 |
| commit | 55e281a57c2ac9acb18836ea7a48f5a553d924e2 (patch) | |
| tree | 7065e72dbed9991e94bbe9695d6c0a9a8560d783 /src | |
| parent | 46891ca052e6049252a560895af55301f5e37b19 (diff) | |
Change data URL path format
Diffstat (limited to 'src')
| -rw-r--r-- | src/App.vue | 4 | ||||
| -rw-r--r-- | src/components/SearchModal.vue | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/App.vue b/src/App.vue index 24ae12b..89d227d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -189,7 +189,7 @@ export default defineComponent({ // Check if data for node-to-expand exists, getting from server if needed let tolNode = this.tolMap.get(layoutNode.name)!; if (!this.tolMap.has(tolNode.children[0])){ - return fetch('/tolnode/' + layoutNode.name + '?type=children') + return fetch('/data/children?name=' + encodeURIComponent(layoutNode.name)) .then(response => response.json()) .then(obj => { Object.getOwnPropertyNames(obj).forEach(key => {this.tolMap.set(key, obj[key])}); @@ -492,7 +492,7 @@ export default defineComponent({ tryLayout(this.activeRoot, this.tileAreaPos, this.tileAreaDims, this.lytOpts, {allowCollapse: true, layoutMap: this.layoutMap}); // Get initial tol node data - fetch('/tolnode/' + rootName) + fetch('/data/node?name=' + encodeURIComponent(rootName)) .then(response => response.json()) .then(obj => { Object.getOwnPropertyNames(obj).forEach(key => {this.tolMap.set(key, obj[key])}); diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index 9c30cbc..f3bb237 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -20,11 +20,12 @@ export default defineComponent({ let input = this.$refs.searchInput as HTMLInputElement; // Query server let url = new URL(window.location.href); - url.pathname = '/tolnode/' + input.value; + url.pathname = '/data/node'; + url.search = '?name=' + encodeURIComponent(input.value); fetch(url.toString()) .then(response => { // Search successful. Get nodes in parent-chain, add to tolMap, then emit event. - url.search = '?type=chain'; + url.pathname = '/data/chain'; fetch(url.toString()) .then(response => response.json()) .then(obj => { |
