fix: Correct UI store instantiation in form components
This commit corrects the UI store instantiation in the following form components: - AsistenciaForm.vue - EmpleadoForm.vue - PlanillaForm.vue - TareaForm.vue The components now correctly import `useUi` from `~/stores/useUi` and instantiate the store using `const uiStore = useUi()`. This adheres to the correct Pinia conventions.
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue';
|
||||
import { useAsistenciasStore } from '../../stores/useAsistencias';
|
||||
import { useUiStore } from '../../stores/useUiStore'; // Import UI store
|
||||
import { useUi } from '@/stores/useUi'; // Corrected UI store import
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -58,7 +58,7 @@ const props = defineProps({
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const asistenciasStore = useAsistenciasStore();
|
||||
const uiStore = useUiStore(); // Instantiate UI store
|
||||
const uiStore = useUi(); // Corrected UI store instantiation
|
||||
|
||||
const formatDateTimeForInput = (dateString) => {
|
||||
const date = dateString ? new Date(dateString) : new Date();
|
||||
|
||||
@@ -150,7 +150,7 @@ import { ref, onMounted, computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useEmpleadosStore } from '@/stores/useEmpleados.js'
|
||||
import { useUiStore } from '@/stores/useUiStore'; // Import UI store
|
||||
import { useUi } from '@/stores/useUi'; // Corrected UI store import
|
||||
|
||||
/* ───── Tipos ───── */
|
||||
interface EmpleadoForm {
|
||||
@@ -181,7 +181,7 @@ const router = useRouter()
|
||||
/* ───── Store ───── */
|
||||
const empleadosStore = useEmpleadosStore()
|
||||
const { currentEmpleado } = storeToRefs(empleadosStore)
|
||||
const uiStore = useUiStore(); // Instantiate UI store
|
||||
const uiStore = useUi(); // Corrected UI store instantiation
|
||||
|
||||
/* ───── State ───── */
|
||||
const form = ref<EmpleadoForm>(defaultForm())
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed, watch } from 'vue';
|
||||
import { usePlanillasStore } from '../../stores/usePlanillas';
|
||||
import { useUiStore } from '../../stores/useUiStore'; // Import UI store
|
||||
import { useUi } from '@/stores/useUi'; // Corrected UI store import
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -64,7 +64,7 @@ const router = useRouter();
|
||||
const route = useRoute(); // Can also get id from route.params.id
|
||||
|
||||
const planillasStore = usePlanillasStore();
|
||||
const uiStore = useUiStore(); // Instantiate UI store
|
||||
const uiStore = useUi(); // Corrected UI store instantiation
|
||||
|
||||
const formData = reactive({
|
||||
titulo: '',
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, onUnmounted, computed, watch } from 'vue';
|
||||
import { useTareasStore } from '../../stores/useTareas';
|
||||
import { useUiStore } from '../../stores/useUiStore'; // Import UI store
|
||||
import { useUi } from '@/stores/useUi'; // Corrected UI store import
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -75,7 +75,7 @@ const props = defineProps({
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const tareasStore = useTareasStore();
|
||||
const uiStore = useUiStore(); // Instantiate UI store
|
||||
const uiStore = useUi(); // Corrected UI store instantiation
|
||||
|
||||
const formatDateForInput = (dateString) => {
|
||||
const date = dateString ? new Date(dateString) : new Date();
|
||||
|
||||
Reference in New Issue
Block a user