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

Function api

tests/playwright/46_flexible_datasets.js:35–46  ·  view source on GitHub ↗
(path, method = 'GET', body)

Source from the content-addressed store, hash-verified

33 attachPageIssueListeners(page, issues);
34
35 const api = (path, method = 'GET', body) => page.evaluate(async ({path, method, body}) => {
36 const response = await fetch(OC.generateUrl('apps/analytics/' + path), {
37 method,
38 headers: OCA.Analytics.headers(),
39 body: body === undefined ? undefined : JSON.stringify(body),
40 });
41 const data = await response.json().catch(() => null);
42 if (!response.ok) {
43 throw new Error(data?.error?.message || data?.message || `HTTP ${response.status}`);
44 }
45 return {status: response.status, data};
46 }, {path, method, body});
47
48 try {
49 steps.push('open analytics and create a classic dataset alongside the flexible one');

Callers 1

Calls 1

evaluateMethod · 0.80

Tested by

no test coverage detected