Update usages of app metadata calls
This commit is contained in:
parent
a26eb57115
commit
a7873caca8
|
@ -35,10 +35,7 @@ export class NavigationStore extends BudiStore {
|
|||
|
||||
async save(navigation) {
|
||||
const appId = get(appStore).appId
|
||||
const app = await API.saveAppMetadata({
|
||||
appId,
|
||||
metadata: { navigation },
|
||||
})
|
||||
const app = await API.saveAppMetadata(appId, { navigation })
|
||||
this.syncAppNavigation(app.navigation)
|
||||
}
|
||||
|
||||
|
|
|
@ -14,19 +14,13 @@ const createsnippets = () => {
|
|||
...get(store).filter(snippet => snippet.name !== updatedSnippet.name),
|
||||
updatedSnippet,
|
||||
]
|
||||
const app = await API.saveAppMetadata({
|
||||
appId: get(appStore).appId,
|
||||
metadata: { snippets },
|
||||
})
|
||||
const app = await API.saveAppMetadata(get(appStore).appId, { snippets })
|
||||
syncMetadata(app)
|
||||
}
|
||||
|
||||
const deleteSnippet = async snippetName => {
|
||||
const snippets = get(store).filter(snippet => snippet.name !== snippetName)
|
||||
const app = await API.saveAppMetadata({
|
||||
appId: get(appStore).appId,
|
||||
metadata: { snippets },
|
||||
})
|
||||
const app = await API.saveAppMetadata(get(appStore).appId, { snippets })
|
||||
syncMetadata(app)
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@ export const createThemeStore = () => {
|
|||
}
|
||||
|
||||
const save = async (theme, appId) => {
|
||||
const app = await API.saveAppMetadata({
|
||||
appId,
|
||||
metadata: { theme },
|
||||
})
|
||||
const app = await API.saveAppMetadata(appId, { theme })
|
||||
store.update(state => {
|
||||
state.theme = app.theme
|
||||
return state
|
||||
|
@ -32,10 +29,7 @@ export const createThemeStore = () => {
|
|||
|
||||
const saveCustom = async (theme, appId) => {
|
||||
const updated = { ...get(store).customTheme, ...theme }
|
||||
const app = await API.saveAppMetadata({
|
||||
appId,
|
||||
metadata: { customTheme: updated },
|
||||
})
|
||||
const app = await API.saveAppMetadata(appId, { customTheme: updated })
|
||||
store.update(state => {
|
||||
state.customTheme = app.customTheme
|
||||
return state
|
||||
|
|
|
@ -128,10 +128,7 @@ export class AppsStore extends BudiStore {
|
|||
}
|
||||
|
||||
async save(appId, value) {
|
||||
await API.saveAppMetadata({
|
||||
appId,
|
||||
metadata: value,
|
||||
})
|
||||
await API.saveAppMetadata(appId, value)
|
||||
this.update(state => {
|
||||
const updatedAppIndex = state.apps.findIndex(
|
||||
app => app.instance._id === appId
|
||||
|
|
Loading…
Reference in New Issue