Skip to content

Commit 2f19140

Browse files
committed
feat: add file name in upload response
1 parent c9d492f commit 2f19140

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/server/routes/api/upload/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const getExtension = (filename: string, override?: string): string => {
4141
export type ApiUploadResponse = {
4242
files: {
4343
id: string;
44+
name: string;
4445
type: string;
4546
url: string;
4647
pending?: boolean;
@@ -212,6 +213,7 @@ export default fastifyPlugin(
212213

213214
response.files.push({
214215
id: fileUpload.id,
216+
name: fileUpload.name,
215217
type: fileUpload.type,
216218
url: encodeURI(responseUrl),
217219
removedGps: removedGps || undefined,

src/server/routes/api/upload/partial.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export default fastifyPlugin(
256256

257257
response.files.push({
258258
id: fileUpload.id,
259+
name: fileUpload.name,
259260
type: fileUpload.type,
260261
url: responseUrl,
261262
pending: true,

0 commit comments

Comments
 (0)