Cleaned up TODOs from file (#1478)
This commit is contained in:
parent
db8d91f889
commit
fa6b486572
1 changed files with 0 additions and 22 deletions
|
@ -236,27 +236,6 @@ class OctoClient {
|
||||||
// Hydrate is important, as it ensures that each block is complete to the current model
|
// Hydrate is important, as it ensures that each block is complete to the current model
|
||||||
const fixedBlocks = OctoUtils.hydrateBlocks(blocks)
|
const fixedBlocks = OctoUtils.hydrateBlocks(blocks)
|
||||||
|
|
||||||
// !TODO: Remove this fixup code
|
|
||||||
for (const block of fixedBlocks) {
|
|
||||||
if (!block.fields) {
|
|
||||||
block.fields = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (block.type === 'image') {
|
|
||||||
if (!block.fields.fileId && block.fields.url) {
|
|
||||||
// Convert deprecated url to fileId
|
|
||||||
try {
|
|
||||||
const url = new URL(block.fields.url)
|
|
||||||
const path = url.pathname
|
|
||||||
const fileId = path.substring(path.lastIndexOf('/') + 1)
|
|
||||||
block.fields.fileId = fileId
|
|
||||||
} catch {
|
|
||||||
Utils.logError(`Failed to get fileId from url: ${block.fields.url}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return fixedBlocks
|
return fixedBlocks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,7 +365,6 @@ class OctoClient {
|
||||||
Utils.log(`uploadFile response: ${text}`)
|
Utils.log(`uploadFile response: ${text}`)
|
||||||
const json = JSON.parse(text)
|
const json = JSON.parse(text)
|
||||||
|
|
||||||
// const json = await this.getJson(response)
|
|
||||||
return json.fileId
|
return json.fileId
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Utils.logError(`uploadFile json ERROR: ${e}`)
|
Utils.logError(`uploadFile json ERROR: ${e}`)
|
||||||
|
|
Loading…
Reference in a new issue