fixed signup and renaming problems

This commit is contained in:
2024-03-12 17:46:44 +01:00
parent d1bdffb834
commit acae90ee13
17 changed files with 96 additions and 78 deletions

View File

@ -1,7 +1,7 @@
<template>
<section v-if="!addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
<h2 v-if="!editable" :class="['maintenance-visits-template-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{
mvt.name }}</h2>
mvt.name }}</h2>
<input v-if="editable" v-model="mvt.name" @change="updateMVT()"
:class="['data', 'mvt-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
<div class="maintenance-visits-template-data">
@ -20,7 +20,8 @@
<div class="data-field" id="info">
<div class="id-type-user" id="ID">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">ID:</pre>
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ mvt.checklistID }}</pre>
<pre
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ mvt.checklistID }}</pre>
</div>
<div class="id-type-user" id="type">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Type:</pre>
@ -92,8 +93,8 @@
</div>
</section>
</template>
<script setup>
import { ref, onMounted, watch } from 'vue';
import Axios from '../axios.config.js';
@ -137,9 +138,6 @@ const confirmDeleteMVT = async () => {
if (confirm("Do you really want to delete this maintenance visit template? It cannot be undone!")) {
try {
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteMaintenanceVisitTemplate/${chosenMVTId.value}`);
store.commit('undoDelete');
store.commit('resetStore');
store.commit('changeToTemplatelist');
} catch (err) {
console.log(err.response.statusText);
}
@ -148,6 +146,9 @@ const confirmDeleteMVT = async () => {
} catch (err) {
console.log(err.response.statusText);
}
store.commit('undoDelete');
store.commit('resetStore');
store.commit('changeToTemplatelist');
} else {
store.commit('undoDelete');
}
@ -278,10 +279,10 @@ onMounted(() => {
export default {
name: "MaintenanceVisitsTemplate",
};
</script>
</script>
<style scoped>
.information {
display: flex;