* authorization added

This commit is contained in:
2023-01-16 01:01:03 +01:00
parent 1834a68aea
commit 0b3a261ecf
8 changed files with 154 additions and 54 deletions

View File

@@ -30,12 +30,13 @@
v-model="selected"
class="bg-gray-50 border mt-2 border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
<option value="nothing" selected>Choose a status</option>
<option v-for="status in statuses" :key="status" :value="status">
{{ status }}
<option v-for="status in statuses" :key="status.position" :value="status.name">
{{ status.name }}
</option>
</select>
<button
class="inline-block px-6 mt-3 py-2.5 bg-green-500 text-white font-medium text-normal rounded shadow-md">
class="inline-block px-6 mt-3 py-2.5 bg-green-500 text-white font-medium text-normal rounded shadow-md"
@click="changeStatus()">
Wächseln
</button>
</div>
@@ -46,7 +47,7 @@
<script>
import { mapActions } from 'vuex'
import router from '../../router/index'
import { getStatuses, changeStatus } from '../../service/ContractsService'
import { getStatuses, postChangeStatus } from '../../service/ContractsService'
export default {
data() {
@@ -66,14 +67,15 @@ export default {
methods: {
...mapActions(['closeModal']),
changeStatus() {
// TODO: selected is not defined
const id = this.selectedContract
if (id === null) {
this.closeModal()
router.push('/error?message=' + 'Contract not found' + '&code=404')
}
if (selected === 'nothing') return
if (this.selected === 'nothing') return
//TODO: provide here contractID
changeStatus(id, this.selected)
postChangeStatus(id, this.selected)
.then(resp => {
this.closeModal()
this.$router.go()