Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var hasMeidoId = false
- // ================================
- const userId = "{{current_user.id}}"
- fetch(`https://freshservicecounter.ringteam.com/getmeidologin?id=${userId}&test=true`).then(res => {
- console.log(res.status)
- if (res.status === 200) hasMeidoId = true
- })
- // ================================
- var weekendOnly = true
- datesInRequest.forEach(date => {
- var weekday = new Date(date).getDay()
- if (weekday !== 6 && weekday !== 0) weekendOnly = false
- })
- if (durationList[values.duration] && officeList[values.office] && accessWeek[values.access_week] && datesInRequest.length && !(datesInRequest.length === 1 && datesInRequest[0] === today) && !accessWeekChanged && !weekendOnly) {
- // ================================
- if (weekdayGlobal === 6 || weekdayGlobal === 0 || (weekdayGlobal === 5 && currentHoursGlobal >= 19 && currentMinutesGlobal >= 30) || values.access_week === "Current week" || !officeMeido[values.office] || !hasMeidoId) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement