mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 10:52:23 +01:00
Simplifiy the MOTD Target
This commit is contained in:
@@ -11,20 +11,10 @@ express.get("/content/api/pages/*", async (req, res) => {
|
|||||||
express.post("/api/v1/fortnite-br/surfaces/motd/target", async (req, res) => {
|
express.post("/api/v1/fortnite-br/surfaces/motd/target", async (req, res) => {
|
||||||
const motdTarget = JSON.parse(JSON.stringify(require("./../responses/motdTarget.json")));
|
const motdTarget = JSON.parse(JSON.stringify(require("./../responses/motdTarget.json")));
|
||||||
|
|
||||||
var Language = "en";
|
|
||||||
|
|
||||||
if (req.body.language) {
|
|
||||||
if (req.body.language.includes("-") && req.body.language != "es-419" && req.body.language != "pt-BR") {
|
|
||||||
Language = req.body.language.split("-")[0];
|
|
||||||
} else {
|
|
||||||
Language = req.body.language;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
motdTarget.contentItems.forEach(item => {
|
motdTarget.contentItems.forEach(item => {
|
||||||
item.contentFields.title = item.contentFields.title[Language];
|
item.contentFields.title = item.contentFields.title[req.body.language];
|
||||||
item.contentFields.body = item.contentFields.body[Language];
|
item.contentFields.body = item.contentFields.body[req.body.language];
|
||||||
})
|
})
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user