PR review comments.

This commit is contained in:
mike12345567 2024-12-04 13:48:30 +00:00
parent 0b8f2c111d
commit da81381d62
4 changed files with 6 additions and 6 deletions

View File

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

View File

@ -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.")
}

View File

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

View File

@ -12,7 +12,7 @@ export enum PluginSource {
URL = "URL",
FILE = "File Upload",
}
export interface FileType {
export interface KoaFile {
path: string | null
name: string | null
}