school-stage stubs #23

Merged
prdcsi merged 1 commits from school-stage-branch into master 2024-06-02 20:26:27 +03:00
Showing only changes of commit a55e6d2ab2 - Show all commits

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) {