* changed mocks, endpoints, routers

feature: #8
This commit is contained in:
2023-01-07 17:47:09 +01:00
parent 93b71954c5
commit 1872097882
4 changed files with 17 additions and 7 deletions

View File

@@ -158,7 +158,17 @@
"name": "Get Open Contracts", "name": "Get Open Contracts",
"request": { "request": {
"method": "GET", "method": "GET",
"header": [] "header": [],
"url": {
"raw": "{{url}}/contracts/open",
"host": [
"{{url}}"
],
"path": [
"contracts",
"open"
]
}
}, },
"response": [ "response": [
{ {
@@ -167,13 +177,13 @@
"method": "GET", "method": "GET",
"header": [], "header": [],
"url": { "url": {
"raw": "{{url}}/contracts/register", "raw": "{{url}}/contracts/open",
"host": [ "host": [
"{{url}}" "{{url}}"
], ],
"path": [ "path": [
"contracts", "contracts",
"register" "open"
] ]
} }
}, },

View File

@@ -73,8 +73,8 @@ const router = createRouter({
} }
}, },
{ {
path: '/contracts/register', path: '/contracts/open',
name: 'contractRegistration', name: 'openContracts',
component: () => import('../views/OpenContractsView.vue'), component: () => import('../views/OpenContractsView.vue'),
meta: { meta: {
requiresAuth: true requiresAuth: true

View File

@@ -20,7 +20,7 @@ export async function getContracts() {
//Auth: provide auth token in request //Auth: provide auth token in request
//OnError: redirect to page /error?message=somemessage&code=404 //OnError: redirect to page /error?message=somemessage&code=404
export async function getOpenContracts() { export async function getOpenContracts() {
return HttpClient.get('contracts/register') //TODO: provide here auth header return HttpClient.get('contracts/open') //TODO: provide here auth header
.then(resp => { .then(resp => {
return resp.data.openContracts return resp.data.openContracts
}) })

View File

@@ -21,7 +21,7 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
Create Auftrag Create Auftrag
</button> </button>
</RouterLink> </RouterLink>
<RouterLink v-if="isEmployee" to="/contracts/register"> <RouterLink v-if="isEmployee" to="/contracts/open">
<button <button
class="bg-emerald-500 text-white active:bg-emerald-600 font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" class="bg-emerald-500 text-white active:bg-emerald-600 font-bold uppercase text-xs px-4 py-2 rounded shadow hover:shadow-md outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150"
type="button"> type="button">