Avoid filter editor sending a prop change when filter is not an array, which was causing extra 409s and causing issues with tables
This commit is contained in:
parent
1ac29025a2
commit
929d1c73d4
|
@ -122,6 +122,9 @@ export const getFrontendStore = () => {
|
||||||
save: async screen => {
|
save: async screen => {
|
||||||
const creatingNewScreen = screen._id === undefined
|
const creatingNewScreen = screen._id === undefined
|
||||||
const response = await api.post(`/api/screens`, screen)
|
const response = await api.post(`/api/screens`, screen)
|
||||||
|
if (response.status !== 200) {
|
||||||
|
return
|
||||||
|
}
|
||||||
screen = await response.json()
|
screen = await response.json()
|
||||||
await store.actions.routing.fetch()
|
await store.actions.routing.fetch()
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
export let value = []
|
export let value = []
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
let drawer
|
let drawer
|
||||||
let tempValue = value
|
let tempValue = value || []
|
||||||
|
|
||||||
$: numFilters = Array.isArray(tempValue)
|
$: numFilters = Array.isArray(tempValue)
|
||||||
? tempValue.length
|
? tempValue.length
|
||||||
|
@ -31,15 +31,6 @@
|
||||||
$: schemaFields = Object.values(schema || {})
|
$: schemaFields = Object.values(schema || {})
|
||||||
$: internalTable = dataSource?.type === "table"
|
$: internalTable = dataSource?.type === "table"
|
||||||
|
|
||||||
// Reset value if value is wrong type for the datasource.
|
|
||||||
// Lucene editor needs an array, and simple editor needs an object.
|
|
||||||
$: {
|
|
||||||
if (!Array.isArray(value)) {
|
|
||||||
tempValue = []
|
|
||||||
dispatch("change", [])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const saveFilter = async () => {
|
const saveFilter = async () => {
|
||||||
dispatch("change", tempValue)
|
dispatch("change", tempValue)
|
||||||
notifications.success("Filters saved.")
|
notifications.success("Filters saved.")
|
||||||
|
|
Loading…
Reference in New Issue