* integration with backend

feature: no-task
This commit is contained in:
2023-01-15 02:14:01 +01:00
parent b633c2795b
commit 1834a68aea
6 changed files with 36 additions and 27 deletions

View File

@@ -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