Emberfire : Attach datas to the users


#1

Hey,

Another newbie question … I am sorry.

I read a tutorial about Emberfire and I need to store more datas from the user than just mail and password. I get the user id, and I created a model named ‘person’ but when I try to save, that dosen’t work, something is missing but I don’t know what.

// my model
import DS from 'ember-data';

export default DS.Model.extend({
  idUser: DS.attr(),
  name : DS.attr()
});
const auth = this.get('firebaseApp').auth();
          auth.createUserWithEmailAndPassword(model.email, model.password).then((userResponse) => {
            const person = this.store.createRecord('person', {
              id: userResponse.uid,
              name: 'test'
              });
              return person.save();
          }).catch(function(error){});
Error: Some errors were encountered while saving (unknown mixin) cqQfMGdENnQx7Ft4P405clyl3bI3
    at reportError (firebase.js:424)
    at firebase.js:444
    at tryCatch (ember.debug.js:59057)
    at invokeCallback (ember.debug.js:59072)
    at publish (ember.debug.js:59040)
    at publishRejection (ember.debug.js:58975)
    at ember.debug.js:38885
    at invokeWithOnError (ember.debug.js:346)
    at Queue.flush (ember.debug.js:405)
    at DeferredActionQueues.flush (ember.debug.js:529)

Something is missing … but I can not say what.

Thanks for any help.


#2

After multiple test, the problem seems to come from the description of the model.