Skip to content

Instantly share code, notes, and snippets.

@Kazuki-tam
Last active February 16, 2022 14:14
Show Gist options
  • Save Kazuki-tam/2355de94127950229cfc63a66d3c79ed to your computer and use it in GitHub Desktop.
Save Kazuki-tam/2355de94127950229cfc63a66d3c79ed to your computer and use it in GitHub Desktop.
カレンダーマスター&テワタシデータ初期化処理
// リセット関数
function resetData() {
const attr = {
attributes: {
'delivery_date': null,
'delivery_time': null,
'受け渡し方法': null,
'受け渡し日': null,
'受け渡し時間': null,
'受け渡し曜日': null,
}
};
fetch('/cart/update.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(attr),
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch((error) => {
console.error('Error:', error);
});
}
// リセット関数実行
resetData();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment