Tasks: print newly added tasks, fixed some bugs

This commit is contained in:
2023-12-31 02:39:01 +01:00
parent 4c9765b4a3
commit 5c769bfa2f
3 changed files with 46 additions and 6 deletions

View File

@@ -31,5 +31,21 @@ export default {
} catch (error) {
console.error('Error fetching data:', error)
}
},
async sendAdd(data, url) {
try {
const response = await fetch(this.api_url + url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`)
}
} catch (error) {
console.error('Error sending data:', error)
}
}
}