Hi guys,
I made an API for my Poll extension, but not it isn't showing any data in the console. (See: data array)
[/img]
As you can see, the model name is showing in the models array but there is no data .
main.js
import Poll from 'shahiemseymor/poll/models/Poll';
app.initializers.add('shahiemseymor-poll', function() {
app.store.models.polls = Poll;
console.log(app.store);
});
Poll.js (model)
import Model from 'flarum/Model';
import mixin from 'flarum/utils/mixin';
export default class Poll extends mixin(Model, {
question: Model.attribute('question')
}) {}
This is the json output from the API url
{"data":[{"type":"polls","id":"1","attributes":{"question":"ddd"}},{"type":"polls","id":"2","attributes":{"question":"dsds"}}]}
Is there something I forgot to do?
Thank you! ?