Node.js based forum software built for the modern web
fix: #12471, remove readable strings
Barış Soner Uşaklı0b1f2546c84d
diff --git a/public/openapi/components/schemas/UserObject.yaml b/public/openapi/components/schemas/UserObject.yamlindex bdd52bc2d1..9b217cee8b 100644--- a/public/openapi/components/schemas/UserObject.yaml+++ b/public/openapi/components/schemas/UserObject.yaml@@ -743,9 +743,7 @@ BanMuteArray:example: "#f44336"until:type: number- untilReadable:- type: string- timestampReadable:+ untilISO:type: stringtimestampISO:type: stringdiff --git a/public/openapi/read/user/userslug/info.yaml b/public/openapi/read/user/userslug/info.yamlindex afec9bc2bd..110e252be5 100644--- a/public/openapi/read/user/userslug/info.yaml+++ b/public/openapi/read/user/userslug/info.yaml@@ -35,8 +35,6 @@ get:timestampISO:type: stringdescription: An ISO 8601 formatted date string (complementing `timestamp`)- timestampReadable:- type: stringadditionalProperties:description: Contextual data is added to this object (such as topic data, etc.)bans:diff --git a/src/user/info.js b/src/user/info.jsindex 3abd580d02..d4667bd83f 100644--- a/src/user/info.js+++ b/src/user/info.js@@ -86,7 +86,6 @@ module.exports = function (User) {flagObj.pid = flagObj.value;flagObj.timestamp = flagObj.score;flagObj.timestampISO = new Date(flagObj.score).toISOString();- flagObj.timestampReadable = new Date(flagObj.score).toString();delete flagObj.value;delete flagObj.score;@@ -105,8 +104,7 @@ module.exports = function (User) {return data.map((banObj, index) => {banObj.user = usersData[index];banObj.until = parseInt(banObj.expire, 10);- banObj.untilReadable = new Date(banObj.until).toString();- banObj.timestampReadable = new Date(parseInt(banObj.timestamp, 10)).toString();+ banObj.untilISO = utils.toISOString(banObj.until);banObj.timestampISO = utils.toISOString(banObj.timestamp);banObj.reason = validator.escape(String(banObj.reason || '')) || noReasonLangKey;return banObj;