chore(plugin-cloud-storage): more req stuff

This commit is contained in:
Elliot DeNolf
2024-02-29 12:24:07 -05:00
parent 4699a37b4b
commit b3fd720668
5 changed files with 10 additions and 6 deletions

View File

@@ -18,7 +18,9 @@ export const getHandler = ({ collection, getStorageClient }: Args): StaticHandle
try { try {
const prefix = await getFilePrefix({ collection, req }) const prefix = await getFilePrefix({ collection, req })
const blockBlobClient = getStorageClient().getBlockBlobClient( const blockBlobClient = getStorageClient().getBlockBlobClient(
path.posix.join(prefix, req.params.filename), // WARNING:
// TODO: Untested for 3.0
path.posix.join(prefix, req.routeParams.filename as string),
) )
const { end, start } = await getRangeFromHeader(blockBlobClient, req.headers.range) const { end, start } = await getRangeFromHeader(blockBlobClient, req.headers.range)

View File

@@ -19,7 +19,9 @@ export const getHandler = ({ bucket, collection, getStorageClient }: Args): Stat
const prefix = await getFilePrefix({ collection, req }) const prefix = await getFilePrefix({ collection, req })
const file = getStorageClient() const file = getStorageClient()
.bucket(bucket) .bucket(bucket)
.file(path.posix.join(prefix, req.params.filename)) // WARNING:
// TODO: Untested for 3.0
.file(path.posix.join(prefix, req.routeParams.filename as string))
const [metadata] = await file.getMetadata() const [metadata] = await file.getMetadata()

View File

@@ -21,7 +21,9 @@ export const getHandler = ({ bucket, collection, getStorageClient }: Args): Stat
const object = await getStorageClient().getObject({ const object = await getStorageClient().getObject({
Bucket: bucket, Bucket: bucket,
Key: path.posix.join(prefix, req.params.filename), // WARNING:
// TODO: Untested for 3.0
Key: path.posix.join(prefix, req.routeParams.filename as string),
}) })
res.set({ res.set({

View File

@@ -36,7 +36,7 @@ export const getStaticHandler = ({ cachingOptions, collection }: Args): StaticHa
collection: collection.slug, collection: collection.slug,
// WARNING: // WARNING:
// TODO: Untested for 3.0 // TODO: Untested for 3.0
filename: req.file.name, filename: req.routeParams.filename as string,
identityID, identityID,
}) })

View File

@@ -11,8 +11,6 @@ export const getCommonBlock = (editor: Editor, match?: NodeMatch<Node>): NodeEnt
const [common, path] = Node.common(editor, range.anchor.path, range.focus.path) const [common, path] = Node.common(editor, range.anchor.path, range.focus.path)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
if (isBlockElement(editor, common) || Editor.isEditor(common)) { if (isBlockElement(editor, common) || Editor.isEditor(common)) {
return [common, path] return [common, path]
} }