1
0
Fork 0
mirror of synced 2024-08-15 10:01:34 +12:00

Remove useless rows store and remove unecessary state updates

This commit is contained in:
Andrew Kingston 2022-12-19 12:35:35 +00:00
parent 20bd1815ac
commit e38e0db2c3
7 changed files with 2 additions and 23 deletions

View file

@ -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}`)

View file

@ -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) {

View file

@ -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) {

View file

@ -104,7 +104,6 @@
}
function onClickTable(table) {
tables.select(table)
$goto(`../../table/${table._id}`)
}

View file

@ -64,7 +64,6 @@
// reload
await datasources.fetch()
await queries.fetch()
await datasources.select(datasourceId)
if (navigateDatasource) {
$goto(`./datasource/${datasourceId}`)

View file

@ -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"

View file

@ -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()