fix: Validate uuid on attachments.create endpoint

This commit is contained in:
Tom Moor
2022-08-20 23:46:01 +02:00
parent f32f07cdcc
commit 72b0e78788

View File

@@ -56,7 +56,8 @@ router.post("attachments.create", auth(), async (ctx) => {
const endpoint = publicS3Endpoint();
const url = `${endpoint}/${key}`;
if (documentId) {
if (documentId !== undefined) {
assertUuid(documentId, "documentId must be a uuid");
const document = await Document.findByPk(documentId, {
userId: user.id,
});