MCPcopy Create free account
hub / github.com/Rello/analytics / fetchDatasets

Function fetchDatasets

js/flow.js:131–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 }));
130 },
131 fetchDatasets() {
132 let requestUrl = OC.generateUrl('apps/analytics/dataset');
133 let headers = new Headers();
134 headers.append('requesttoken', OC.requestToken);
135 headers.append('OCS-APIREQUEST', 'true');
136
137 fetch(requestUrl, {
138 method: 'GET',
139 headers: headers
140 })
141 .then(response => {
142 if (!response.ok) {
143 throw new Error('Dataset request failed');
144 }
145 return response.json();
146 })
147 .then(data => {
148 this.items = Array.isArray(data) ? data : [];
149 })
150 .catch(() => {
151 this.items = [];
152 });
153 },
154 fetchDataloads(datasetId) {
155 if (datasetId === 0) {
156 this.dataloads = [];

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected