0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Fixed Product API handling of original options

no-issue

The default include values are empty arrays which are not falsy, so the
boolean OR operator would never use the second operand. Instead we
concatenate the options together so that the API can use all of them.
This commit is contained in:
Fabien O'Carroll 2021-06-08 11:41:00 +01:00
parent 09a817da16
commit 76a54059b0

View file

@ -26,7 +26,7 @@ function paginatedProducts(page, _apiConfig, frame) {
products: page.data.map((model) => {
return cleanIncludes(
allowedIncludes,
requestedQueryIncludes || requestedOptionsIncludes,
requestedQueryIncludes.concat(requestedOptionsIncludes),
serializeProduct(model, frame.options, frame.apiType)
);
}),
@ -48,7 +48,7 @@ function singleProduct(model, _apiConfig, frame) {
products: [
cleanIncludes(
allowedIncludes,
requestedQueryIncludes || requestedOptionsIncludes,
requestedQueryIncludes.concat(requestedOptionsIncludes),
serializeProduct(model, frame.options, frame.apiType)
)
]