Skip to content

Commit

Permalink
[Hexlet#1280] hexlet correction widget
Browse files Browse the repository at this point in the history
  • Loading branch information
evdokimoww authored and evdokimoww committed Apr 13, 2022
1 parent d10bbf1 commit 5134252
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions resources/js/correction.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Modal } from 'bootstrap';
import axios from 'axios';

const ctrlEnterHandler = (event) => {
if (event.keyCode === 13 && event.ctrlKey) {
Expand All @@ -20,18 +19,7 @@ const ctrlEnterHandler = (event) => {
btn.addEventListener('click', async () => {
const textarea = document.getElementById('correctionModalTextarea');

console.log(textarea.value);

try {
await axios.post('https://hexlet-correction.herokuapp.com/api/workspaces/Title/typos', {}, {
headers: {
'Content-Type': 'application/json',
Authorization: 'Token e0b71e21-0bf8-49f3-a990-7d08bbe65170',
},
});
} catch (err) {
console.log(err.message);
}
console.log('selection: ', textarea.value);

modal.hide();
});
Expand Down

0 comments on commit 5134252

Please sign in to comment.