Scan aus der Dateienseite starten
This commit is contained in:
@@ -44,6 +44,20 @@ const pickFileTargets = (target: unknown) => {
|
||||
)
|
||||
}
|
||||
|
||||
const readFileFolder = (target: unknown) => {
|
||||
if (!target || typeof target !== "object" || Array.isArray(target)) return null
|
||||
|
||||
const folder = (target as Record<string, any>).folder
|
||||
return typeof folder === "string" && folder.trim() ? folder.trim() : null
|
||||
}
|
||||
|
||||
const readFileType = (target: unknown) => {
|
||||
if (!target || typeof target !== "object" || Array.isArray(target)) return null
|
||||
|
||||
const type = (target as Record<string, any>).type
|
||||
return typeof type === "string" && type.trim() ? type.trim() : null
|
||||
}
|
||||
|
||||
export default async function instanceAgentGatewayRoutes(server: FastifyInstance) {
|
||||
await server.register(multipart, {
|
||||
limits: { fileSize: 100 * 1024 * 1024 },
|
||||
@@ -206,8 +220,8 @@ export default async function instanceAgentGatewayRoutes(server: FastifyInstance
|
||||
content: fileBuffer,
|
||||
contentType: data.mimetype || "application/pdf",
|
||||
},
|
||||
null,
|
||||
null,
|
||||
readFileFolder(job.target),
|
||||
readFileType(job.target),
|
||||
{
|
||||
...pickFileTargets(job.target),
|
||||
createdBy: job.requestedBy,
|
||||
|
||||
Reference in New Issue
Block a user