From 53043efd2e4eda0f1d29596bfcf63d4fab04ea1b Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 25 Nov 2024 13:07:09 +0000 Subject: [PATCH] refactor(routes)!: rename `backgroundColor` param to `background_color` BREAKING CHANGE: `backgroundColor` query string param renamed to `background_color` --- src/routes/docx/html/index.js | 2 +- src/routes/docx/html/schema.js | 2 +- src/routes/pdf/html/index.js | 2 +- src/routes/pdf/html/route.test.js | 2 +- src/routes/pdf/html/schema.js | 2 +- src/routes/rtf/html/index.js | 2 +- src/routes/rtf/html/route.test.js | 2 +- src/routes/rtf/html/schema.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/docx/html/index.js b/src/routes/docx/html/index.js index 71cf404b..5589586d 100644 --- a/src/routes/docx/html/index.js +++ b/src/routes/docx/html/index.js @@ -79,7 +79,7 @@ async function route(server, options) { res.type("text/html; charset=utf-8"); return server.tidyCss(tidiedHtml, { fonts: req.query.fonts, - backgroundColor: req.query.backgroundColor, + backgroundColor: req.query.background_color, }); }, }); diff --git a/src/routes/docx/html/schema.js b/src/routes/docx/html/schema.js index 1684e947..3697ee57 100644 --- a/src/routes/docx/html/schema.js +++ b/src/routes/docx/html/schema.js @@ -26,7 +26,7 @@ const docxToHtmlPostSchema = { query: S.object() .additionalProperties(false) .prop( - "backgroundColor", + "background_color", S.string() .description( "HTML document background color; set or replace the `background-color` property value of `div` CSS selectors" diff --git a/src/routes/pdf/html/index.js b/src/routes/pdf/html/index.js index 69e643b5..788eb7a9 100644 --- a/src/routes/pdf/html/index.js +++ b/src/routes/pdf/html/index.js @@ -81,7 +81,7 @@ async function route(server, options) { return server.tidyCss(tidiedHtml, { fonts: req.query.fonts, - backgroundColor: req.query.backgroundColor, + backgroundColor: req.query.background_color, }); }, }); diff --git a/src/routes/pdf/html/route.test.js b/src/routes/pdf/html/route.test.js index 96eb547e..35ac2b5c 100644 --- a/src/routes/pdf/html/route.test.js +++ b/src/routes/pdf/html/route.test.js @@ -16,7 +16,7 @@ const tidyHtml = require("../../../plugins/tidy-html"); // Generates 64 different combinations const queryStrings = generateCombos([ - { backgroundColor: "white" }, + { background_color: "white" }, { firstPageToConvert: "1" }, { fonts: "Arial" }, { ignoreImages: "true" }, diff --git a/src/routes/pdf/html/schema.js b/src/routes/pdf/html/schema.js index 15ecce44..a5bd4e31 100644 --- a/src/routes/pdf/html/schema.js +++ b/src/routes/pdf/html/schema.js @@ -21,7 +21,7 @@ const pdfToHtmlPostSchema = { query: S.object() .additionalProperties(false) .prop( - "backgroundColor", + "background_color", S.string() .description( "HTML document background color; set or replace the `background-color` property value of `div` CSS selectors" diff --git a/src/routes/rtf/html/index.js b/src/routes/rtf/html/index.js index 29a40001..4071ef96 100644 --- a/src/routes/rtf/html/index.js +++ b/src/routes/rtf/html/index.js @@ -81,7 +81,7 @@ async function route(server, options) { return server.tidyCss(tidiedHtml, { fonts: req.query.fonts, - backgroundColor: req.query.backgroundColor, + backgroundColor: req.query.background_color, }); }, }); diff --git a/src/routes/rtf/html/route.test.js b/src/routes/rtf/html/route.test.js index d22d0662..6682baee 100644 --- a/src/routes/rtf/html/route.test.js +++ b/src/routes/rtf/html/route.test.js @@ -15,7 +15,7 @@ const tidyHtml = require("../../../plugins/tidy-html"); // Generates 12 different combinations const queryStrings = generateCombos([ - { backgroundColor: "white" }, + { background_color: "white" }, { fonts: "Arial" }, { fonts: "Arial, Sans Serif" }, { language: "fr" }, diff --git a/src/routes/rtf/html/schema.js b/src/routes/rtf/html/schema.js index 6577eb44..c8716774 100644 --- a/src/routes/rtf/html/schema.js +++ b/src/routes/rtf/html/schema.js @@ -21,7 +21,7 @@ const rtfToHtmlPostSchema = { query: S.object() .additionalProperties(false) .prop( - "backgroundColor", + "background_color", S.string() .description( "HTML document background color; set or replace the `background-color` property value of `div` CSS selectors"