Enhance frontend components by importing API_BASE_URL for consistent API endpoint usage. This update improves code maintainability and prepares the components for future API integrations.
This commit is contained in:
@@ -500,6 +500,8 @@ class TimeEntryService {
|
|||||||
// Berechne Überstunden für die aktuelle Woche
|
// Berechne Überstunden für die aktuelle Woche
|
||||||
const weekData = await this.getWeekOverview(uid, 0);
|
const weekData = await this.getWeekOverview(uid, 0);
|
||||||
|
|
||||||
|
console.log(`🔍 Wochenüberstunden-Berechnung START: userDailyHours=${userDailyHours}`);
|
||||||
|
|
||||||
let weekSollMinutes = 0; // Soll-Arbeitszeit für die Woche
|
let weekSollMinutes = 0; // Soll-Arbeitszeit für die Woche
|
||||||
let weekIstMinutes = 0; // Ist-Arbeitszeit für die Woche
|
let weekIstMinutes = 0; // Ist-Arbeitszeit für die Woche
|
||||||
|
|
||||||
@@ -584,13 +586,17 @@ class TimeEntryService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let daySollHours = userDailyHours; // Fallback: User's daily_hours
|
let daySollHours = userDailyHours; // Fallback: User's daily_hours
|
||||||
|
console.log(` Tag ${day.date}: userDailyHours=${userDailyHours}, applicableTimewish=${applicableTimewish ? applicableTimewish.hours + 'h' : 'keine'}`);
|
||||||
|
|
||||||
if (applicableTimewish && applicableTimewish.wishtype === 2 && applicableTimewish.hours) {
|
if (applicableTimewish && applicableTimewish.wishtype === 2 && applicableTimewish.hours) {
|
||||||
daySollHours = applicableTimewish.hours;
|
daySollHours = applicableTimewish.hours;
|
||||||
|
console.log(` → Verwende Timewish: ${daySollHours}h`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bei halbem Urlaubstag: Soll halbiert
|
// Bei halbem Urlaubstag: Soll halbiert
|
||||||
if (day.vacation && day.vacation.halfDay) {
|
if (day.vacation && day.vacation.halfDay) {
|
||||||
daySollHours = daySollHours / 2;
|
daySollHours = daySollHours / 2;
|
||||||
|
console.log(` → Halber Urlaubstag: ${daySollHours}h`);
|
||||||
}
|
}
|
||||||
|
|
||||||
weekSollMinutes += daySollHours * 60;
|
weekSollMinutes += daySollHours * 60;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useAuthStore } from '../stores/authStore'
|
import { useAuthStore } from '../stores/authStore'
|
||||||
|
import { API_BASE_URL } from '@/config/api'
|
||||||
|
|
||||||
|
const API_URL = API_BASE_URL
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const now = new Date()
|
const now = new Date()
|
||||||
const selectedMonth = ref(now.getMonth() + 1)
|
const selectedMonth = ref(now.getMonth() + 1)
|
||||||
|
|||||||
@@ -89,7 +89,9 @@ import { ref } from 'vue'
|
|||||||
import { useAuthStore } from '../stores/authStore'
|
import { useAuthStore } from '../stores/authStore'
|
||||||
import { useModal } from '../composables/useModal'
|
import { useModal } from '../composables/useModal'
|
||||||
import Modal from '../components/Modal.vue'
|
import Modal from '../components/Modal.vue'
|
||||||
|
import { API_BASE_URL } from '@/config/api'
|
||||||
|
|
||||||
|
const API_URL = API_BASE_URL
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,9 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted } from 'vue'
|
||||||
import { useAuthStore } from '../stores/authStore'
|
import { useAuthStore } from '../stores/authStore'
|
||||||
|
import { API_BASE_URL } from '@/config/api'
|
||||||
|
|
||||||
|
const API_URL = API_BASE_URL
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
const selectedYear = ref(new Date().getFullYear())
|
const selectedYear = ref(new Date().getFullYear())
|
||||||
const statistics = ref(null)
|
const statistics = ref(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user