Skip to content

Commit e004f00

Browse files
committed
Add warning message when dataset is empty or has the wrong format
1 parent bb70d00 commit e004f00

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/vue-ui-rating.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,11 @@ onMounted(() => {
106106
});
107107
108108
function prepareChart() {
109-
if(objectIsEmpty(props.dataset)) {
109+
if (!Object.hasOwn(props.dataset, 'rating') || objectIsEmpty(props.dataset)) {
110110
error({
111111
componentName: 'VueUiRating',
112-
type: 'dataset'
112+
type: 'datasetAttribute',
113+
property: 'rating'
113114
})
114115
}
115116
units.value = [];

src/components/vue-ui-smiley.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ onMounted(() => {
3434
});
3535
3636
function prepareChart() {
37-
if(objectIsEmpty(props.dataset)) {
37+
if (!Object.hasOwn(props.dataset, 'rating') || objectIsEmpty(props.dataset)) {
3838
error({
3939
componentName: 'VueUiSmiley',
40-
type: 'dataset'
40+
type: 'datasetAttribute',
41+
property: 'rating'
4142
})
4243
}
4344
}

0 commit comments

Comments
 (0)