urlForCreateRecord's snapshot is empty


#1

Hi, I have been trying to get project id with following task adapter hence when creating task it should set project by url. On backend REST API their url is not possible to modify by me. When i console.log(snapshot.belongsto) it returns null. Am i have to create project adapter for this to work?

import drfadapter from './drf';
export default drfadapter.extend({
  urlforcreaterecord(modelname, snapshot) {
    let projectid = snapshot.belongsto('project').id;
    return `/${this.namespace}/api/projects/${projectid}/tasks/`;
  }
});