Merge pull request 'school-stage stubs' (#26) from school-stage-branch into master

Reviewed-on: https://git.inno-js.ru/bro-students/multy-stub/pulls/26
This commit is contained in:
prdcsi 2024-06-03 23:20:29 +03:00
commit 7b1ce2ae83
2 changed files with 15 additions and 6 deletions

View File

@ -16,11 +16,11 @@ router.post('/login', (request, response) => {
const router = require('express').Router(); const router = require('express').Router();
router.get('/teachers', (request, response) => { router.get('/teachers', (request, response) => {
response.send(require('./json/teachers/success.json')) response.send(require('../json/teachers/success.json'))
}) })
router.get('/account', (request, response) => { router.get('/account', (request, response) => {
response.send(require('./json/account/account.json')) response.send(require('../json/account/account.json'))
}) })
router.post('/login', (request, response) => { router.post('/login', (request, response) => {
@ -28,7 +28,7 @@ router.post('/login', (request, response) => {
const password = request.body.password; const password = request.body.password;
try { try {
const users = require('./json/account/account.json'); const users = require('../json/account/account.json');
const user = users.data.find(user => user.login === login && user.password === password); const user = users.data.find(user => user.login === login && user.password === password);
if (!user) { if (!user) {

View File

@ -1,6 +1,15 @@
{ {
"data": "data":
{ [
"imageUrl": ["teacher1", "teacher2"] {
} "imageUrl": "teacher1",
"name": "Иванова Валерия Константинова",
"status": "Педагог с бакалаврской степенью по театральному искусству. Обладает более чем 15-летним опытом работы на театральной сцене, является действующим актером театра и кино."
},
{
"imageUrl": "teacher2",
"name": "Рогов Сергей Владимирович",
"status": "Педагог по актерскому мастерству с высшим образованием в области режиссуры, постановщик спектаклей. Опыт работы с детьми 10 лет."
}
]
} }