ccdb-web/app/controllers/collections/create.js
2017-10-07 17:37:24 -07:00

21 lines
676 B
JavaScript

import Ember from 'ember';
import CollectionValidations from '../../validations/collection';
import { schema } from '../../models/collection';
import ValidationMixin from '../../mixins/validation';
const { Controller } = Ember;
export default Controller.extend(ValidationMixin, {
CollectionValidations,
actions: {
onSave(changeset) {
const postSave = () => { this.transitionToRoute('collections.index'); };
return this.validationSave(changeset, schema, postSave);
},
onCancel(changeset) {
const postCancel = () => { this.transitionToRoute('collections.index'); };
return this.validationCancel(changeset, postCancel);
},
},
});