Skip to content

Commit

Permalink
Merge pull request #4782 from knownasilya/patch-9
Browse files Browse the repository at this point in the history
[DOC] shorthand methods and quotes for adapter errors
  • Loading branch information
locks authored Jan 27, 2017
2 parents 3b814b6 + f0a0a4b commit 7f220ef
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions addon/adapters/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if (extendedErrorsEnabled) {
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
updateRecord: function() {
updateRecord() {
// Fictional adapter that always rejects
return Ember.RSVP.reject(new DS.InvalidError([
{
Expand Down Expand Up @@ -347,9 +347,9 @@ export const ServerError = extendedErrorsEnabled ?
const { errorsHashToArray } = DS;
let errors = {
base: "Invalid attributes on saving this record",
name: "Must be present",
age: ["Must be present", "Must be a number"]
base: 'Invalid attributes on saving this record',
name: 'Must be present',
age: ['Must be present', 'Must be a number']
};
let errorsArray = errorsHashToArray(errors);
Expand Down Expand Up @@ -421,19 +421,19 @@ export function errorsHashToArray(errors) {
let errorsArray = [
{
title: "Invalid Attribute",
detail: "Must be present",
source: { pointer: "/data/attributes/name" }
title: 'Invalid Attribute',
detail: 'Must be present',
source: { pointer: '/data/attributes/name' }
},
{
title: "Invalid Attribute",
detail: "Must be present",
source: { pointer: "/data/attributes/age" }
title: 'Invalid Attribute',
detail: 'Must be present',
source: { pointer: '/data/attributes/age' }
},
{
title: "Invalid Attribute",
detail: "Must be a number",
source: { pointer: "/data/attributes/age" }
title: 'Invalid Attribute',
detail: 'Must be a number',
source: { pointer: '/data/attributes/age' }
}
];
Expand Down

0 comments on commit 7f220ef

Please sign in to comment.