refactor: handle unknown raw language option
This commit is contained in:
committed by
Andrew Bastin
parent
01764dbb8b
commit
86803dc2be
@@ -200,11 +200,12 @@ const getHoppReqBody = (item: Item): HoppRESTReqBody => {
|
|||||||
getHoppReqHeaders(item).find(
|
getHoppReqHeaders(item).find(
|
||||||
({ key }) => key.toLowerCase() === "content-type"
|
({ key }) => key.toLowerCase() === "content-type"
|
||||||
)?.value ??
|
)?.value ??
|
||||||
PMRawLanguageOptionsToContentTypeMap[
|
get(
|
||||||
|
PMRawLanguageOptionsToContentTypeMap,
|
||||||
get(body, "options.raw.language", "text") as PMRawLanguage
|
get(body, "options.raw.language", "text") as PMRawLanguage
|
||||||
]
|
)
|
||||||
|
|
||||||
if (body.raw !== undefined && body.raw !== null)
|
if (contentType && body.raw !== undefined && body.raw !== null)
|
||||||
return {
|
return {
|
||||||
contentType: contentType as any,
|
contentType: contentType as any,
|
||||||
body: replacePMVarTemplating(body.raw),
|
body: replacePMVarTemplating(body.raw),
|
||||||
|
|||||||
Reference in New Issue
Block a user