Skip to content

Commit

Permalink
Merge pull request #1028 from uasoft-indonesia/bugfix/v3/nullable-field
Browse files Browse the repository at this point in the history
fix bug nullable empty
  • Loading branch information
rizkiheryandi authored Sep 18, 2023
2 parents 8fbcd11 + 0300c9a commit d7d6616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 1 addition & 7 deletions src/resources/badaso/pages/crud-generated/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,7 @@ export default {
// init data rows
const dataRows = {};
for (const row of this.dataType.dataRows) {
if (
(row && row.value) ||
row.type == "switch" ||
row.type == "slider"
) {
dataRows[row.field] = row.value;
}
dataRows[row.field] = row.value;
if (row.type == "data_identifier") {
dataRows[row.field] = this.userId;
}
Expand Down
8 changes: 3 additions & 5 deletions src/resources/badaso/pages/crud-generated/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,9 @@ export default {
data.value = val.split(",");
}
} else if (data.type == "switch") {
data.value = this.record[
this.$caseConvert.stringSnakeToCamel(data.field)
]
? this.record[this.$caseConvert.stringSnakeToCamel(data.field)]
: false;
const val = this.record[this.$caseConvert.stringSnakeToCamel(data.field)];
data.value = val > 0 ? true : false;
} else if (data.type == "slider") {
data.value = parseInt(
this.record[this.$caseConvert.stringSnakeToCamel(data.field)]
Expand Down

0 comments on commit d7d6616

Please sign in to comment.