feat(extension): submit code to server
All checks were successful
Publish docker image / Publish (push) Successful in 2m22s
All checks were successful
Publish docker image / Publish (push) Successful in 2m22s
This commit is contained in:
parent
72a0edb26c
commit
33fc26e0bc
2 changed files with 19 additions and 2 deletions
|
@ -39,7 +39,23 @@ function interceptSubmit(details) {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('request for activity', activityId, 'the code', code, 'was', codeCorrect ? 'correct' : 'incorrect');
|
console.log('request for activity', activityId, 'the code', code, 'was', codeCorrect ? 'correct' : 'incorrect');
|
||||||
// TODO: Send data to server.
|
|
||||||
|
const query = new URLSearchParams({
|
||||||
|
date: activity.date,
|
||||||
|
time: activity.time,
|
||||||
|
activity: activity.name,
|
||||||
|
space: activity.space,
|
||||||
|
});
|
||||||
|
|
||||||
|
fetch('https://aci-api.ashhhleyyy.dev/api/codes?' + query, {
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
code: activity.code,
|
||||||
|
success: codeCorrect,
|
||||||
|
}),
|
||||||
|
}).then(res => console.log('submitted code: ', res)).error(e => console.error('failed to submit code', e'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function interceptCode(details) {
|
function interceptCode(details) {
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
this.SERVER_URL = 'https://aci-api.ashhhleyyy.dev';
|
//this.SERVER_URL = 'https://aci-api.ashhhleyyy.dev';
|
||||||
|
this.SERVER_URL = 'http://localhost:8000';
|
||||||
|
|
Loading…
Reference in a new issue