PR review comments.
This commit is contained in:
parent
0b8f2c111d
commit
da81381d62
|
@ -26,7 +26,7 @@ export async function find(ctx: UserCtx<void, FindIntegrationResponse>) {
|
|||
}
|
||||
const integration = await getDefinition(ctx.params.type)
|
||||
if (!integration) {
|
||||
ctx.throw(400, "Integration not found")
|
||||
ctx.throw(404, "Integration not found")
|
||||
}
|
||||
ctx.body = integration
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@ import {
|
|||
getPluginMetadata,
|
||||
extractTarball,
|
||||
} from "../../../utilities/fileSystem"
|
||||
import { FileType } from "@budibase/types"
|
||||
import { KoaFile } from "@budibase/types"
|
||||
|
||||
export async function fileUpload(file: FileType) {
|
||||
export async function fileUpload(file: KoaFile) {
|
||||
if (!file.name || !file.path) {
|
||||
throw new Error("File is not valid - cannot upload.")
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { FileType, Plugin, PluginSource, PluginType } from "@budibase/types"
|
||||
import { KoaFile, Plugin, PluginSource, PluginType } from "@budibase/types"
|
||||
import {
|
||||
db as dbCore,
|
||||
objectStore,
|
||||
|
@ -26,7 +26,7 @@ export async function fetch(type?: PluginType): Promise<Plugin[]> {
|
|||
}
|
||||
}
|
||||
|
||||
export async function processUploaded(plugin: FileType, source?: PluginSource) {
|
||||
export async function processUploaded(plugin: KoaFile, source?: PluginSource) {
|
||||
const { metadata, directory } = await fileUpload(plugin)
|
||||
pluginCore.validate(metadata?.schema)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export enum PluginSource {
|
|||
URL = "URL",
|
||||
FILE = "File Upload",
|
||||
}
|
||||
export interface FileType {
|
||||
export interface KoaFile {
|
||||
path: string | null
|
||||
name: string | null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue