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

Function fetchDataloads

js/flow.js:154–183  ·  view source on GitHub ↗
(datasetId)

Source from the content-addressed store, hash-verified

152 });
153 },
154 fetchDataloads(datasetId) {
155 if (datasetId === 0) {
156 this.dataloads = [];
157 return;
158 }
159
160 let requestUrl = OC.generateUrl('apps/analytics/dataload') + '?' + new URLSearchParams({
161 datasetId: datasetId
162 });
163 let headers = new Headers();
164 headers.append('requesttoken', OC.requestToken);
165 headers.append('OCS-APIREQUEST', 'true');
166
167 fetch(requestUrl, {
168 method: 'GET',
169 headers: headers
170 })
171 .then(response => {
172 if (!response.ok) {
173 throw new Error('Dataload request failed');
174 }
175 return response.json();
176 })
177 .then(data => {
178 this.dataloads = Array.isArray(data.dataloads) ? data.dataloads : [];
179 })
180 .catch(() => {
181 this.dataloads = [];
182 });
183 },
184 },
185 };
186

Callers

nothing calls this directly

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected