* integration with backend
feature: no-task
This commit is contained in:
@@ -9,7 +9,7 @@ import router from '../router'
|
||||
export async function getContracts() {
|
||||
return HttpClient.get('contracts') //TODO: provide here auth header
|
||||
.then(resp => {
|
||||
return resp.data.contracts
|
||||
return resp.data
|
||||
})
|
||||
.catch(error => {
|
||||
router.push('/error?message=' + error.message + '&code=' + error.code)
|
||||
@@ -82,20 +82,10 @@ export async function createContract(contractId, contractName, contractClient, c
|
||||
client: contractClient,
|
||||
password: contractPassword
|
||||
})
|
||||
.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 deleteContract(contractId) {
|
||||
return HttpClient.delete('/contract/delete', {
|
||||
id: contractId
|
||||
})
|
||||
return HttpClient.delete('/contract/delete?id=' + contractId)
|
||||
.then(resp => {
|
||||
//TODO: send also auth token with request
|
||||
return resp.data
|
||||
|
||||
Reference in New Issue
Block a user