mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
take empty date strings into account
This commit is contained in:
parent
ad1e7b576c
commit
be77c3729b
@ -814,7 +814,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
||||
},
|
||||
updateStartDate({commit}, payload) {
|
||||
const url = `/api/1.0/person/accompanying-course/${id}.json`;
|
||||
const body = { type: "accompanying_period", openingDate: { datetime: datetimeToISO(ISOToDate(payload)) }};
|
||||
const date = payload === null || payload === '' ? null : { datetime: datetimeToISO(ISOToDate(payload)) }
|
||||
const body = { type: "accompanying_period", openingDate: date};
|
||||
return makeFetch('PATCH', url, body)
|
||||
.then((response) => {
|
||||
commit('updateStartDate', response.openingDate);
|
||||
|
@ -111,9 +111,9 @@ const store = createStore({
|
||||
id: e.evaluation.id,
|
||||
type: e.evaluation.type
|
||||
},
|
||||
startDate: e.startDate !== null ? { datetime: datetimeToISO(ISOToDate(e.startDate)) } : null,
|
||||
endDate: e.endDate !== null ? { datetime: datetimeToISO(ISOToDate(e.endDate)) } : null,
|
||||
maxDate: e.maxDate !== null ? { datetime: datetimeToISO(ISOToDate(e.maxDate)) } : null,
|
||||
startDate: e.startDate === null || e.startDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.startDate)) },
|
||||
endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) },
|
||||
maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) },
|
||||
warningInterval: intervalDaysToISO(e.warningInterval),
|
||||
comment: e.comment,
|
||||
documents: e.documents
|
||||
|
@ -278,7 +278,7 @@ const store = createStore({
|
||||
type: conc.person.type
|
||||
},
|
||||
start_date: {
|
||||
datetime: datetimeToISO(ISOToDate(state.startDate))
|
||||
datetime: state.startDate === null || state.startDate === '' ? null : datetimeToISO(ISOToDate(state.startDate))
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user