remove console.logs

This commit is contained in:
William Buezas 2024-03-21 13:15:11 -03:00
parent 65da9a3e69
commit d20828ac7c
2 changed files with 6 additions and 41 deletions

View File

@ -116,7 +116,6 @@ const setDate = async (date) => {
startOfWeek.value = newStartOfWeek;
endOfWeek.value = newEndOfWeek;
selectedWeekNumber.value = getWeekNumber(newStartOfWeek); // Asignar el número de la semana
console.log('selectedWeekNumber:: ', selectedWeekNumber.value);
getWeekDates(newStartOfWeek, newEndOfWeek);
@ -230,7 +229,6 @@ const getAbsences = async () => {
};
const { data } = await axios.get('Calendars/absences', { params });
console.log('absenses:: ', data);
if (data) addEvents(data);
};
@ -239,7 +237,6 @@ const hasEvents = (day) => {
};
const addEvents = (data) => {
console.log('ADD EVENTS:: ');
const events = {};
const addEvent = (day, event) => {
@ -272,7 +269,6 @@ const addEvents = (data) => {
const timestamp = day.dated.getTime();
if (events[timestamp]) day.event = events[timestamp];
});
console.log('weekdays after events:: ', weekDays.value);
};
const fetchHours = async () => {
@ -396,12 +392,9 @@ const getMailStates = async (date) => {
{ params }
);
workerTimeControlMails.value = data;
console.log('workerTimeControlMails: ', workerTimeControlMails.value);
// await repaint();
};
const showWorkerTimeForm = (propValue, formType) => {
console.log('workerTimeFormDialogRef:: ', workerTimeFormDialogRef.value);
if (formType === 'edit') {
workerTimeFormProps.entryId = propValue;
} else {
@ -439,8 +432,10 @@ const isSatisfied = async () => {
};
const isUnsatisfied = async (reason) => {
console.log('unsatiesfied reason:: ', reason);
if (!reason) return; // TODO: Mostrar notify de 'debe haber una razon'
if (!reason) {
notify(t('You must indicate a reason', 'negative'));
return;
}
updateWorkerTimeControlMail('REVISE', reason);
};
@ -463,14 +458,11 @@ const resendEmail = async () => {
onBeforeMount(() => {
weekdayStore.initStore();
console.log('asdasdasd:: ', weekdayStore);
});
onMounted(async () => {
setDate(Date.vnNew());
stateStore.rightDrawer = true;
const test = useArrayData('workerData').store.data;
console.log('test:: ', test);
});
</script>

View File

@ -1,4 +1,4 @@
import { computed, ref, reactive } from 'vue';
import { reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import { defineStore } from 'pinia';
@ -13,19 +13,11 @@ export const useWeekdayStore = defineStore('weekdayStore', () => {
{ code: 'sat', name: 'Saturday' },
];
const localeOrder = {
es: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'],
en: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'],
};
const { t, locale } = useI18n();
const localeWeekdays = ref([]);
const { t } = useI18n();
const weekdaysMap = reactive({});
const initStore = () => {
getWeekdaysMap();
getLocales();
console.log('weekdaysMap:: ', weekdaysMap);
};
const getWeekdaysMap = () => {
@ -45,27 +37,8 @@ export const useWeekdayStore = defineStore('weekdayStore', () => {
});
};
const getLocales = () => {
if (localeWeekdays.value.length > 0) return localeWeekdays.value;
for (let code of localeOrder.es) {
console.log('code:: ', code);
localeWeekdays.value.push(weekdaysMap[code]);
}
console.log('localeWeekdays:: ', localeWeekdays.value);
return localeWeekdays.value;
};
// const orderLocales = (weekDaysArray) => {
// const order = localeOrder[locale.value] || localeOrder.en;
// const orderedLocales = [];
// for (let code of order) orderedLocales.push(weekDaysArray[code]);
// // return order.map((code) => localeWeekdays.value.find((day) => day.code === code));
// };
return {
initStore,
getLocales,
localeWeekdays,
weekdaysMap,
};
});