createFetchResponse.ts 387 B

123456789101112131415
  1. import { FetchResponse } from '@grafana/runtime';
  2. export function createFetchResponse<T>(data: T): FetchResponse<T> {
  3. return {
  4. data,
  5. status: 200,
  6. url: 'http://localhost:3000/api/ds/query',
  7. config: { url: 'http://localhost:3000/api/ds/query' },
  8. type: 'basic',
  9. statusText: 'Ok',
  10. redirected: false,
  11. headers: {} as unknown as Headers,
  12. ok: true,
  13. };
  14. }