chore(plugin-cloud-storage): more req stuff
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -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({
|
||||||
|
|||||||
@@ -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,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user