fix file uploading
This commit is contained in:
@ -92,7 +92,7 @@ export const uploadFileRequestResolver = authorized<
|
||||
uploadFileData = await authTrx((t) =>
|
||||
t.getRepository(UploadFile).save({
|
||||
url: input.url,
|
||||
userId: uid,
|
||||
user: { id: uid },
|
||||
fileName,
|
||||
status: UploadFileStatus.Initialized,
|
||||
contentType: input.contentType,
|
||||
@ -156,7 +156,6 @@ export const uploadFileRequestResolver = authorized<
|
||||
itemType: itemTypeForContentType(input.contentType),
|
||||
uploadFile: { id: uploadFileData.id },
|
||||
slug: generateSlug(uploadFilePathName),
|
||||
state: LibraryItemState.Succeeded,
|
||||
},
|
||||
uid
|
||||
)
|
||||
|
||||
@ -320,7 +320,10 @@ export const updateLibraryItem = async (
|
||||
): Promise<LibraryItem> => {
|
||||
const updatedLibraryItem = await authTrx(async (tx) => {
|
||||
const itemRepo = tx.withRepository(libraryItemRepository)
|
||||
await itemRepo.save({ id, ...libraryItem })
|
||||
await itemRepo.update(
|
||||
id,
|
||||
libraryItem as QueryDeepPartialEntity<LibraryItem>
|
||||
)
|
||||
|
||||
return itemRepo.findOneByOrFail({ id })
|
||||
})
|
||||
|
||||
@ -82,7 +82,6 @@ export const savePage = async (
|
||||
url: input.url,
|
||||
title: input.title,
|
||||
userId: user.id,
|
||||
itemId: clientRequestId,
|
||||
slug,
|
||||
croppedPathname,
|
||||
parsedContent: parseResult.parsedContent,
|
||||
|
||||
Reference in New Issue
Block a user