adding related data to backand api

对着背影说爱祢 提交于 2019-12-02 05:26:59
user3375230

You need to add deep=true in the query string of the POST/PUT url please see an example using this in a many-to-many relation http://codepen.io/yariv/pen/eJQPEz

function updatePet(updatedPet) {
    $http({
      method: 'PUT',
      url: Backand.getApiUrl() + baseUrl + petsObjName + '/' + updatedPet.id,
     params: {
        deep: true,
        returnObject: true
     }, // to save the users array
     data: updatedPet
     }).then(function(response) {
     //$scope.readList(petsObjName);
    });
}

detailed answer here: How to create objects that have relationships when using Backand BaaS? related question Update a complex object on Backand using $http PUT

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!