feat: add file name in upload response

This commit is contained in:
diced
2025-10-03 21:01:18 -07:00
parent c9d492f9d2
commit 2f19140085
2 changed files with 3 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ export const getExtension = (filename: string, override?: string): string => {
export type ApiUploadResponse = { export type ApiUploadResponse = {
files: { files: {
id: string; id: string;
name: string;
type: string; type: string;
url: string; url: string;
pending?: boolean; pending?: boolean;
@@ -212,6 +213,7 @@ export default fastifyPlugin(
response.files.push({ response.files.push({
id: fileUpload.id, id: fileUpload.id,
name: fileUpload.name,
type: fileUpload.type, type: fileUpload.type,
url: encodeURI(responseUrl), url: encodeURI(responseUrl),
removedGps: removedGps || undefined, removedGps: removedGps || undefined,

View File

@@ -256,6 +256,7 @@ export default fastifyPlugin(
response.files.push({ response.files.push({
id: fileUpload.id, id: fileUpload.id,
name: fileUpload.name,
type: fileUpload.type, type: fileUpload.type,
url: responseUrl, url: responseUrl,
pending: true, pending: true,