Remove useless rows store and remove unecessary state updates
This commit is contained in:
parent
20bd1815ac
commit
e38e0db2c3
|
@ -21,8 +21,6 @@
|
||||||
// Create datasource
|
// Create datasource
|
||||||
await datasources.save(datasource)
|
await datasources.save(datasource)
|
||||||
notifications.success(`Relationship information saved.`)
|
notifications.success(`Relationship information saved.`)
|
||||||
const tableList = await tables.fetch()
|
|
||||||
await tables.select(tableList.find(tbl => tbl._id === table._id))
|
|
||||||
dispatch("updatecolumns")
|
dispatch("updatecolumns")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error saving relationship info: ${err}`)
|
notifications.error(`Error saving relationship info: ${err}`)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { tables, rows } from "stores/backend"
|
import { tables } from "stores/backend"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import RowFieldControl from "../RowFieldControl.svelte"
|
import RowFieldControl from "../RowFieldControl.svelte"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
@ -25,7 +25,6 @@
|
||||||
try {
|
try {
|
||||||
await API.saveRow({ ...row, tableId: table._id })
|
await API.saveRow({ ...row, tableId: table._id })
|
||||||
notifications.success("Row saved successfully")
|
notifications.success("Row saved successfully")
|
||||||
rows.save()
|
|
||||||
dispatch("updaterows")
|
dispatch("updaterows")
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.handled) {
|
if (error.handled) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { tables, rows } from "stores/backend"
|
import { tables } from "stores/backend"
|
||||||
import { roles } from "stores/backend"
|
import { roles } from "stores/backend"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import RowFieldControl from "../RowFieldControl.svelte"
|
import RowFieldControl from "../RowFieldControl.svelte"
|
||||||
|
@ -57,7 +57,6 @@
|
||||||
try {
|
try {
|
||||||
await API.saveRow({ ...row, tableId: table._id })
|
await API.saveRow({ ...row, tableId: table._id })
|
||||||
notifications.success("User saved successfully")
|
notifications.success("User saved successfully")
|
||||||
rows.save()
|
|
||||||
dispatch("updaterows")
|
dispatch("updaterows")
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.handled) {
|
if (error.handled) {
|
||||||
|
|
|
@ -104,7 +104,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClickTable(table) {
|
function onClickTable(table) {
|
||||||
tables.select(table)
|
|
||||||
$goto(`../../table/${table._id}`)
|
$goto(`../../table/${table._id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,6 @@
|
||||||
// reload
|
// reload
|
||||||
await datasources.fetch()
|
await datasources.fetch()
|
||||||
await queries.fetch()
|
await queries.fetch()
|
||||||
await datasources.select(datasourceId)
|
|
||||||
|
|
||||||
if (navigateDatasource) {
|
if (navigateDatasource) {
|
||||||
$goto(`./datasource/${datasourceId}`)
|
$goto(`./datasource/${datasourceId}`)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
export { database } from "./database"
|
export { database } from "./database"
|
||||||
export { tables } from "./tables"
|
export { tables } from "./tables"
|
||||||
export { views } from "./views"
|
export { views } from "./views"
|
||||||
export { rows } from "./rows"
|
|
||||||
export { permissions } from "./permissions"
|
export { permissions } from "./permissions"
|
||||||
export { roles } from "./roles"
|
export { roles } from "./roles"
|
||||||
export { datasources } from "./datasources"
|
export { datasources } from "./datasources"
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
import { writable, get } from "svelte/store"
|
|
||||||
import { tables } from "./"
|
|
||||||
|
|
||||||
export function createRowsStore() {
|
|
||||||
const { subscribe } = writable([])
|
|
||||||
|
|
||||||
return {
|
|
||||||
subscribe,
|
|
||||||
save: () => tables.select(get(tables).selected),
|
|
||||||
delete: () => tables.select(get(tables).selected),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const rows = createRowsStore()
|
|
Loading…
Reference in New Issue