How to use the @ember-data/adapter/error.errorsArrayToHash function in @ember-data/adapter

To help you get started, we’ve selected a few @ember-data/adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github m1nl / pompa / app / controllers / targets / from-victims.js View on Github external
function(response) {
        if (response.errors) {
          let hash = errorsArrayToHash(response.errors);

          Object.keys(hash).forEach(function(k) {
            self.model.errors.set(k, hash[k].map((v) => { return { message: v } }));
          });
        }

        if (this.newGroup && group) {
          group.destroyRecord();
        }

        deferred.reject();
      }
    );