Skip to content

Commit

Permalink
changes in the convertFormValue function
Browse files Browse the repository at this point in the history
  • Loading branch information
sinisaos committed Sep 15, 2023
1 parent 94549f5 commit dd05068
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
8 changes: 0 additions & 8 deletions admin_ui/src/components/RowFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import Vue from "vue"
import FilterForm from "./FilterForm.vue"
import { APIResponseMessage } from "../interfaces"
import { secondsToISO8601Duration } from "../utils"
export default Vue.extend({
props: {
Expand Down Expand Up @@ -63,13 +62,6 @@ export default Vue.extend({
: value
}
if (
this.schema.properties[key]?.anyOf[0].format ==
"duration"
) {
value = secondsToISO8601Duration(value)
}
if (value == "null") {
json[`${key}__operator`] = "is_null"
} else {
Expand Down
17 changes: 9 additions & 8 deletions admin_ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,33 +125,34 @@ export function convertFormValue(params: {

if (value == "null") {
value = null
} else if (schema.properties[key]["anyOf"][0].type == "array") {
} else if (schema?.properties[key].type == "array") {
value = JSON.parse(String(value))
} else if (schema?.properties[key]["anyOf"][0].format == "uuid" &&
} else if (schema?.properties[key].format == "uuid" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key]["anyOf"][0].format == "email" &&
} else if (schema?.properties[key].format == "email" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key]["anyOf"][0].format == "date-time" &&
} else if (schema?.properties[key].format == "date-time" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key]["anyOf"][0].format == "date" &&
} else if (schema?.properties[key].format == "date" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key]["anyOf"][0].type == "integer" &&
} else if (schema?.properties[key].format == "json" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key]["anyOf"][0].type == "number" &&
}
else if (schema?.properties[key]["anyOf"][0].type == "integer" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
} else if (schema?.properties[key].format == "json" &&
} else if (schema?.properties[key]["anyOf"][0].type == "number" &&
schema?.properties[key].extra["nullable"] == true
&& value == "") {
value = null
Expand Down

0 comments on commit dd05068

Please sign in to comment.