mirror of
https://github.com/colanode/colanode.git
synced 2025-12-16 03:37:51 +01:00
Don't change upload id on resumed uploads (#175)
This commit is contained in:
@@ -179,14 +179,12 @@ export const fileUploadTusRoute: FastifyPluginCallbackZod = (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the upload record
|
|
||||||
const uploadId = generateId(IdType.Upload);
|
|
||||||
const createdUpload = await database
|
const createdUpload = await database
|
||||||
.insertInto('uploads')
|
.insertInto('uploads')
|
||||||
.returningAll()
|
.returningAll()
|
||||||
.values({
|
.values({
|
||||||
file_id: fileId,
|
file_id: fileId,
|
||||||
upload_id: uploadId,
|
upload_id: generateId(IdType.Upload),
|
||||||
workspace_id: workspaceId,
|
workspace_id: workspaceId,
|
||||||
root_id: file.rootId,
|
root_id: file.rootId,
|
||||||
mime_type: file.attributes.mimeType,
|
mime_type: file.attributes.mimeType,
|
||||||
@@ -198,9 +196,6 @@ export const fileUploadTusRoute: FastifyPluginCallbackZod = (
|
|||||||
})
|
})
|
||||||
.onConflict((oc) =>
|
.onConflict((oc) =>
|
||||||
oc.columns(['file_id']).doUpdateSet({
|
oc.columns(['file_id']).doUpdateSet({
|
||||||
upload_id: uploadId,
|
|
||||||
created_at: new Date(),
|
|
||||||
created_by: request.user.id,
|
|
||||||
mime_type: file.attributes.mimeType,
|
mime_type: file.attributes.mimeType,
|
||||||
size: file.attributes.size,
|
size: file.attributes.size,
|
||||||
path: path,
|
path: path,
|
||||||
|
|||||||
Reference in New Issue
Block a user