Site icon Hip-Hop Website Design and Development

WP-API + JS Spine shopper – the best way to replace publish meta

Utilizing the WP API and Spine-based JS shopper, I am attempting to replace a publish’s metadata as follows:

var parentId = 96; // the publish id
var metaData = new wp.api.collections.PostMeta('', {dad or mum: parentId});
metaData.fetch()
  .executed(perform(information) {
    var someKey = information.findWhere({key: 'someKey'});
    someKey.set('worth', 'newValue');

    someKey.save();
  });

Every part works wonderful till the calling of save(), which throws the next error:

PUT http://instance.org/wp-json/wp/v2/posts/undefined/meta/1901 404 (Not Discovered)

Making an attempt to sync the gathering additionally fails.

Any ideas? Thanks!