Skip to content
Snippets Groups Projects
Commit 4b137410 authored by permcu's avatar permcu
Browse files

Add default value to absence-reason-chip if none is provided

parent 772e22a9
No related branches found
No related tags found
1 merge request!30Resolve "Add default value to absence-reason-chip if none is provided"
Pipeline #190007 passed with warnings
......@@ -14,7 +14,17 @@ export default {
};
},
apollo: {
absenceReasons: gqlAbsenceReasons,
absenceReasons: {
query: gqlAbsenceReasons,
result({ data }) {
if (!this.innerValue) {
const defaultReason = data.absenceReasons.find((ar) => ar.default);
if (defaultReason) {
this.updateInnerValue(defaultReason.id);
}
}
},
},
},
props: {
allowEmpty: {
......@@ -23,7 +33,8 @@ export default {
},
value: {
type: [String, Number],
required: true,
required: false,
default: null,
},
emptyValue: {
type: [String, Number],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment