Skip to content

Instantly share code, notes, and snippets.

@omayib
Created August 11, 2021 12:36
Show Gist options
  • Save omayib/018f616f337c12af524a44b23ad4cf8b to your computer and use it in GitHub Desktop.
Save omayib/018f616f337c12af524a44b23ad4cf8b to your computer and use it in GitHub Desktop.
MarkAsDone.js
//1st : ambil data array list mahasiswa, untuk dilihat list DataID
var list = []
//2nd : buat function iterasi, untuk meng-update setiap DataID
function mark(){
for( let i=0;i<list.length;i++){
console.log(list[i].DataId);
fetch("https://dosen.amikom.ac.id/api/ujian/mark_checked", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"sec-ch-ua": "\"Chromium\";v=\"92\", \" Not A;Brand\";v=\"99\", \"Google Chrome\";v=\"92\"",
"sec-ch-ua-mobile": "?1",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://dosen.amikom.ac.id/ujian/",
"referrerPolicy": "same-origin",
"body": "csrf_name=c88831f6a9a796c943d67dc9a21dfc7c&DataId="+list[i].DataId,
"method": "POST",
"mode": "cors",
"credentials": "include"
});
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment