Created
November 8, 2018 05:38
-
-
Save tinybeans/5f923f88dede12971715c51656ff987c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mtappVars.DataAPI.getContentData(31, 3, 3, function (res) { | |
const cd = jQuery.extend({}, res); | |
for (let i = 0; i < cd.data.length; i++) { | |
if (cd.data[i].label === "取扱店舗") { | |
cd.data[i].data = null; | |
} | |
} | |
mtappVars.DataAPI.updateContentData(31, 3, 3, cd, function (newCd) { | |
console.log(newCd); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
送信されるデータを良く見てみたら、、
content_data: {"author":{"displayName":"tinybeans","id":"1","userpicUrl":null},"basename":"06bed0e01cb73fa5040e2e726f03de7335617791","blog":{"id":"31"},"createdDate":"2018-10-26T11:14:03 09:00","data":"[{\"data\":[],\"id\":\"41\"}]","date":"2018-10-19T06:51:14 09:00","id":3,"label":"桜並木を自宅で楽しめる歴史ある建築物件","modifiedDate":"2018-11-09T02:04:40 09:00","status":"Publish","unpublishedDate":null,"updatable":true}
更新したい部分だけ、
"data":"[{\"data\":[],\"id\":\"41\"}]"
のように値がオブジェクト全体が文字列になっていました。なので、下記のようにすべて文字列にしてから送信したら成功しました!
どうもありがとうございました!