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