* fixes of error catching in posting comment

* function move to next step
feature: #12
This commit is contained in:
2023-01-13 15:02:23 +01:00
parent 71331b046d
commit 155b9f56cd
3 changed files with 31 additions and 14 deletions

View File

@@ -93,7 +93,7 @@ export async function createContract(contractId, contractName, contractClient, c
}
export async function deleteContract(contractId) {
return HttpClient.delete('/contract', {
return HttpClient.delete('/contract/delete', {
id: contractId
})
.then(resp => {
@@ -106,14 +106,12 @@ export async function deleteContract(contractId) {
})
}
export async function saveComment(comment) {
return HttpClient.post('/comments', comment)
.then(resp => {
//TODO: send also auth token with request
return resp.data
})
.catch(error => {
console.error(error)
router.push('/error?message=' + error.message + '&code=' + error.code)
})
export async function saveComment(comment, contractId) {
return HttpClient.post('/contract/' + contractId + '/comments', comment)
}
export async function moveToNextStep(contractId) {
return HttpClient.post('/contract/nextstep', {
id: contractId
})
}