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) const integration = await getDefinition(ctx.params.type)
if (!integration) { if (!integration) {
ctx.throw(400, "Integration not found") ctx.throw(404, "Integration not found")
} }
ctx.body = integration ctx.body = integration
} }

View File

@ -3,9 +3,9 @@ import {
getPluginMetadata, getPluginMetadata,
extractTarball, extractTarball,
} from "../../../utilities/fileSystem" } 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) { if (!file.name || !file.path) {
throw new Error("File is not valid - cannot upload.") 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 { import {
db as dbCore, db as dbCore,
objectStore, 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) const { metadata, directory } = await fileUpload(plugin)
pluginCore.validate(metadata?.schema) pluginCore.validate(metadata?.schema)

View File

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