1.3.0 • Published 11 years ago

jungles-types v1.3.0

Weekly downloads
21
License
-
Repository
-
Last release
11 years ago

Types

This module puts the validation layer infront of data.create and data.update. So you don't always have to manually call validate when updating or creating data. This will be used by the rest layer in the future so we have one place to create and update data + validation.

API

Create

var data = require('jungles-data-memory');
var t = types(settings, data([])).create({ name: 'snowboard', type: 'product' });

t.success(function (response) {
  // response is the created object
});

t.error(function (errors) {
  // errors are validation errors
});

Update

var data = require('jungles-data-memory');
var t = types(settings, data([])).update({ path '/snowboard', name: 'skateboard' });

t.success(function (response) {
  // response is the updated object
});

t.error(function (errors) {
  // errors are validation errors
});
1.3.0

11 years ago

1.2.2

11 years ago

1.2.1

11 years ago

1.2.0

11 years ago

1.1.1

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago