Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] shorthand methods and quotes for adapter errors #4782

Merged
merged 1 commit into from
Jan 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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