Update builder plugin store with new types

This commit is contained in:
Andrew Kingston 2024-12-12 14:51:52 +00:00
parent a706a767a7
commit 0cbf0a7a4b
No known key found for this signature in database
2 changed files with 2 additions and 14 deletions

View File

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

View File

@ -1,17 +1,13 @@
import { writable } from "svelte/store"
import { PluginSource } from "constants/index"
import { Plugin } from "@budibase/types"
import { API } from "api"
interface Plugin {
_id: string
}
export function createPluginsStore() {
const { subscribe, set, update } = writable<Plugin[]>([])
async function load() {
const plugins = await API.getPlugins()
const plugins = (await API.getPlugins()) as Plugin[]
set(plugins)
}