js-data-http icon indicating copy to clipboard operation
js-data-http copied to clipboard

Docs issue: js-data-http

Open BovineEnthusiast opened this issue 5 years ago • 0 comments

http://www.js-data.io/v3.0/docs/js-data-http

The code does not compile on TS version 3.1.6:

import { DataStore } from 'js-data';
import { HttpAdapter, addAction } from 'js-data-http';

const store = new DataStore();
const httpAdapter = new HttpAdapter();

store.registerAdapter('http', httpAdapter, { 'default': true });

// Setup action: GET /reports/schools/:school_id/teachers
@addAction('getTeacherReports', {
  pathname: 'teachers',
  method: 'GET'
}); // <---- Error: Declaration expected
store.defineMapper('school', {
  endpoint: 'schools'
});

BovineEnthusiast avatar Jan 04 '19 22:01 BovineEnthusiast