Skip to content

Custom actions support #27

Open
Open
@Tronix117

Description

@Tronix117

Add support for deserialize/serialize for custom actions:

store.defineMapper('school', {
  endpoint: 'schools',
});

addAction('createTeacherReport', {
  pathname: 'teachers',
  method: 'POST'
})(store.getMapper('school'));

store.getMapper('school').createTeacherReport(1234, {
  data: { someAttribute: 123 }
}).then(function (response) {
  console.log('response', response.data);
});

See if in the then there should be response or directly data, in which case we can use raw: true to get the response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions