Tasks: print newly added tasks, fixed some bugs
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user