From d46841c21f51ccf0fdd19b4b28f19d63dd18f109 Mon Sep 17 00:00:00 2001 From: Julya Shapaeva Date: Sat, 30 Nov 2024 14:54:07 +0300 Subject: [PATCH 1/2] Update paths to json files --- server/routers/dogsitters-finder/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/routers/dogsitters-finder/index.js b/server/routers/dogsitters-finder/index.js index afa0060..8cd7b63 100644 --- a/server/routers/dogsitters-finder/index.js +++ b/server/routers/dogsitters-finder/index.js @@ -10,13 +10,13 @@ router.post("/auth", (request, response) => { const {phoneNumber, password} = request.body; console.log(phoneNumber, password); if (phoneNumber === '89999999999') { - response.send(require("../json/auth/dogsitter.success.json")) + response.send(require("./json/auth/dogsitter.success.json")) } else if (phoneNumber === '89555555555') { - response.status(400).send(require("../json/auth/error.json")) + response.status(400).send(require("./json/auth/error.json")) } else { - response.send(require("../json/auth/owner.success.json")) + response.send(require("./json/auth/owner.success.json")) } }) @@ -24,13 +24,13 @@ router.post("/register", (request, response) => { const {firstName, secondName, phoneNumber, password, role} = request.body; console.log(phoneNumber, password, role); if (phoneNumber === '89283244141' || phoneNumber === '89872855893') { - response.status(400).send(require("../json/register/error.json")) + response.status(400).send(require("./json/register/error.json")) } else if (role === 'dogsitter') { - response.send(require("../json/register/dogsitter.success.json")) + response.send(require("./json/register/dogsitter.success.json")) } else { - response.send(require("../json/register/owner.success.json")) + response.send(require("./json/register/owner.success.json")) } }) -- 2.45.2 From f7ac265e3b682a0dbad2592f8975560766de3fbe Mon Sep 17 00:00:00 2001 From: Julya Shapaeva Date: Sat, 30 Nov 2024 16:04:59 +0300 Subject: [PATCH 2/2] Replace users.json to users/ folder --- server/routers/dogsitters-finder/index.js | 2 +- server/routers/dogsitters-finder/json/{ => users}/users.json | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename server/routers/dogsitters-finder/json/{ => users}/users.json (100%) diff --git a/server/routers/dogsitters-finder/index.js b/server/routers/dogsitters-finder/index.js index 8cd7b63..85c9e95 100644 --- a/server/routers/dogsitters-finder/index.js +++ b/server/routers/dogsitters-finder/index.js @@ -3,7 +3,7 @@ const { response } = require('express'); const router = require('express').Router(); router.get("/users", (request, response) => { - response.send(require("./json/users.json")) + response.send(require("./json/users/users.json")) }) router.post("/auth", (request, response) => { diff --git a/server/routers/dogsitters-finder/json/users.json b/server/routers/dogsitters-finder/json/users/users.json similarity index 100% rename from server/routers/dogsitters-finder/json/users.json rename to server/routers/dogsitters-finder/json/users/users.json -- 2.45.2