mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 02:42:22 +01:00
Adjust motd to also work on newer builds
This commit is contained in:
@@ -8,17 +8,19 @@ express.get("/content/api/pages/*", async (req, res) => {
|
||||
res.json(contentpages)
|
||||
})
|
||||
|
||||
express.post("/api/v1/fortnite-br/surfaces/motd/target", async (req, res) => {
|
||||
const motdTarget = JSON.parse(JSON.stringify(require("./../responses/Athena/motdTarget.json")));
|
||||
express.post("/api/v1/fortnite-br/surfaces/*/target", async (req, res) => {
|
||||
const motd = JSON.parse(JSON.stringify(require("./../responses/Athena/motd.json")));
|
||||
const fields = ["title", "body", "TeaserTitle", "FullScreenTitle", "FullScreenBody"];
|
||||
|
||||
try {
|
||||
motdTarget.contentItems.forEach(item => {
|
||||
item.contentFields.title = item.contentFields.title[req.body.language];
|
||||
item.contentFields.body = item.contentFields.body[req.body.language];
|
||||
motd.contentItems.forEach(item => {
|
||||
fields.forEach(field => {
|
||||
item.contentFields[field] = item.contentFields[field][req.body.language];
|
||||
})
|
||||
})
|
||||
} catch (err) {}
|
||||
|
||||
res.json(motdTarget)
|
||||
res.json(motd)
|
||||
})
|
||||
|
||||
module.exports = express;
|
||||
Reference in New Issue
Block a user