* setup application for contract

This commit is contained in:
2023-01-16 17:29:26 +01:00
parent 0b3a261ecf
commit 7d03a8563a
7 changed files with 39 additions and 27 deletions

View File

@@ -31,7 +31,7 @@ export async function getOpenContracts() {
}
}) //TODO: provide here auth header
.then(resp => {
return resp.data.openContracts
return resp.data
})
.catch(error => {
router.push('/error?message=' + error.message + '&code=' + error.code)
@@ -60,12 +60,15 @@ export async function getContractById(identifier, authToken) {
})
}
export async function applyContract(contractID, prefRole) {
export async function applyContract(contractID, prefRole, userName, userPhone, userEmail) {
return HttpClient.post(
'/contract/apply',
{
id: contractID,
role: prefRole
role: prefRole,
name: userName,
phone: userPhone,
email: userEmail
},
{
headers: {
@@ -84,17 +87,14 @@ export async function applyContract(contractID, prefRole) {
}
export async function misapply(contractID) {
return HttpClient.post(
'/contract/misapply',
{
id: contractID
},
{
headers: {
Authorization: 'Bearer ' + store.state.keycloak.keycloak.token
}
return HttpClient.post('/contract/' + contractID + '/misapply', {
id : contractID,
email : store.state.keycloak.keycloak.tokenParsed.email
}, {
headers: {
Authorization: 'Bearer ' + store.state.keycloak.keycloak.token
}
)
})
.then(resp => {
//TODO: send also auth token with request
return resp.data
@@ -151,8 +151,8 @@ export async function moveToNextStep(contractId) {
'/contract/nextstep?id=' + contractId,
{},
{
headers: {
Authorization: 'Bearer ' + store.state.keycloak.keycloak.token
headers: {
Authorization: 'Bearer ' + store.state.keycloak.keycloak.token
}
}
)