refactor: refs #7869 modified max months data

This commit is contained in:
Jon Elias 2025-03-12 13:49:38 +01:00
parent fad667444c
commit 807d5f12fa
2 changed files with 7 additions and 2 deletions

View File

@ -80,6 +80,8 @@ const exclusionGeoCreate = async () => {
};
const exclusionCreate = async () => {
const defaultMonths = await axios.get('ZoneConfigs');
const nMonths = defaultMonths.data[0].defaultMonths;
const body = {
dated: dated.value,
};
@ -87,7 +89,7 @@ const exclusionCreate = async () => {
for (const id of zoneIds) {
const url = `Zones/${id}/exclusions`;
let today = moment(dated.value);
let lastDay = today.clone().add(4, 'months').endOf('month');
let lastDay = today.clone().add(nMonths, 'months').endOf('month');
const { data } = await axios.get(`Zones/getEventsFiltered`, {
params: {

View File

@ -67,6 +67,9 @@ const inclusionType = computed({
const arrayData = useArrayData('ZoneEvents');
const createEvent = async () => {
const defaultMonths = await axios.get('ZoneConfigs');
const nMonths = defaultMonths.data[0].defaultMonths;
eventInclusionFormData.value.weekDays = weekdayStore.toSet(
eventInclusionFormData.value.wdays,
eventInclusionFormData.value.wdays,
@ -85,7 +88,7 @@ const createEvent = async () => {
let today = eventInclusionFormData.value.dated
? moment(eventInclusionFormData.value.dated)
: moment(dated.value);
let lastDay = today.clone().add(4, 'months').endOf('month');
let lastDay = today.clone().add(nMonths, 'months').endOf('month');
const { data } = await axios.get(`Zones/getEventsFiltered`, {
params: {