feature(freetracker): landing requests

This commit is contained in:
Andrey Ivlev 2025-01-18 20:28:22 +03:00
parent 3d52ef9d4c
commit 552457b5cb
6 changed files with 72 additions and 0 deletions

View File

@ -1,5 +1,6 @@
const router = require('express').Router();
router.use('/performer', require('./dashboard-performer'))
router.use('/landing', require('./landing'))
module.exports = router;

View File

@ -0,0 +1,29 @@
const Router = require('express').Router;
const router = Router()
const values = {
'blocks': 'success',
'application': 'success'
}
const timer = (_req, _res, next) => {
setTimeout(() => next(), 500)
}
router.use(timer)
router.get(
'/blocks',
(req, res) =>
res.send(require(`./json/blocks-${values['blocks']}.json`))
)
router.post(
'/application',
(req, res) => {
res.send(require(`./json/application-${values['application']}.json`))
}
)
module.exports = router

View File

@ -0,0 +1,7 @@
{
"success": false,
"body": { },
"errors": [
"Что-то пошло не так"
]
}

View File

@ -0,0 +1,4 @@
{
"success": true,
"body": { }
}

View File

@ -0,0 +1,9 @@
{
"success": false,
"body": {
"blocks": []
},
"errors": [
"Что-то пошло не так"
]
}

View File

@ -0,0 +1,22 @@
{
"success": true,
"body": {
"blocks": [
{
"titleKey":"block1.title",
"textKey":"block1.subtitle",
"imageName":"truck1"
},
{
"titleKey":"block2.title",
"textKey":"block2.subtitle",
"imageName":"truck2"
},
{
"titleKey":"block3.title",
"textKey":"block3.subtitle",
"imageName":"truck3"
}
]
}
}