Дай бог здоровья Андрею, помог отчистить кеш для отчета

This commit is contained in:
Кашин Максим 2023-12-28 14:23:04 +04:00
parent f70e94584e
commit 524c1f135a
3 changed files with 23 additions and 3 deletions

View File

@ -150,7 +150,7 @@ interface MyServerService {
//Раздача с тлф //Раздача с тлф
private const val BASE_URL = "http://192.168.138.47:8079/" private const val BASE_URL = "http://192.168.138.47:8079/"
//Пк дома //Пк дома
/* private const val BASE_URL = "http://192.168.0.104:8079/"*/ /*private const val BASE_URL = "http://192.168.0.104:8079/"*/
//private const val BASE_URL = "http://10.0.2.2:8079/" //private const val BASE_URL = "http://10.0.2.2:8079/"
@Volatile @Volatile

View File

@ -4,7 +4,14 @@
"id": 1, "id": 1,
"login": "admin", "login": "admin",
"role": "admin", "role": "admin",
"password": "admin" "password": "admin",
"items": [
{
"id": 7,
"count": 5,
"bikeId": 8
}
]
}, },
{ {
"id": 2, "id": 2,
@ -116,10 +123,19 @@
"id": 7, "id": 7,
"dateTime": 2030, "dateTime": 2030,
"weight": 10, "weight": 10,
"radius": 20, "radius": 30,
"colorbike": "Красный", "colorbike": "Красный",
"maxCount": 10, "maxCount": 10,
"bikeId": 8 "bikeId": 8
},
{
"dateTime": 2003,
"weight": 15.7,
"radius": 16.5,
"colorbike": "Жёлтый",
"maxCount": 10,
"bikeId": 7,
"id": 8
} }
], ],
"bikes": [ "bikes": [

View File

@ -3,6 +3,8 @@ const data = require('./data.json');
module.exports = (req, res, next) => { module.exports = (req, res, next) => {
if (req.url.startsWith('/search') && req.method === 'GET') { if (req.url.startsWith('/search') && req.method === 'GET') {
try { try {
delete require.cache[require.resolve('./data.json')];
const data = require('./data.json');
const searchText = req.query.name; const searchText = req.query.name;
const searched = data.products.filter( const searched = data.products.filter(
(product) => (product) =>
@ -15,6 +17,8 @@ module.exports = (req, res, next) => {
} }
} else if (req.url.startsWith('/report') && req.method === 'GET') { } else if (req.url.startsWith('/report') && req.method === 'GET') {
try { try {
delete require.cache[require.resolve('./data.json')];
const data = require('./data.json');
// Добавляем фильтрацию по полю dateTime // Добавляем фильтрацию по полю dateTime
const fromDate = req.query.fromDate; const fromDate = req.query.fromDate;
const toDate = req.query.toDate; const toDate = req.query.toDate;