Update builder plugin store with new types
This commit is contained in:
parent
a706a767a7
commit
0cbf0a7a4b
|
@ -1,8 +0,0 @@
|
||||||
declare module "api" {
|
|
||||||
const API: {
|
|
||||||
getPlugins: () => Promise<any>
|
|
||||||
createPlugin: (plugin: object) => Promise<any>
|
|
||||||
uploadPlugin: (plugin: FormData) => Promise<any>
|
|
||||||
deletePlugin: (id: string) => Promise<void>
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +1,13 @@
|
||||||
import { writable } from "svelte/store"
|
import { writable } from "svelte/store"
|
||||||
import { PluginSource } from "constants/index"
|
import { PluginSource } from "constants/index"
|
||||||
|
import { Plugin } from "@budibase/types"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
|
||||||
interface Plugin {
|
|
||||||
_id: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createPluginsStore() {
|
export function createPluginsStore() {
|
||||||
const { subscribe, set, update } = writable<Plugin[]>([])
|
const { subscribe, set, update } = writable<Plugin[]>([])
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
const plugins = await API.getPlugins()
|
const plugins = (await API.getPlugins()) as Plugin[]
|
||||||
set(plugins)
|
set(plugins)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue