* Page with open contracts

feature: #8
This commit is contained in:
2023-01-07 00:34:41 +01:00
parent aff1564b64
commit 3b417c9ddd
6 changed files with 152 additions and 18 deletions

View File

@@ -16,6 +16,19 @@ export async function getContracts() {
})
}
//REST: GET /contracts
//Auth: provide auth token in request
//OnError: redirect to page /error?message=somemessage&code=404
export async function getOpenContracts() {
return HttpClient.get('contracts/register') //todo: provide here auth header
.then(resp => {
return resp.data.openContracts
})
.catch(error => {
router.push('/error?message=' + error.message + '&code=' + error.code)
})
}
//Request in order to retrieve specific contract using ID
//Backend: extra roles check. Allow admin, verwaltung, employee.
//REST: GET /contract?id=someId