Compare commits

..

10 Commits

Author SHA1 Message Date
9ee59256a9 feat: generate order number (#69)
Добавил генерацию номера заказа при создании

Co-authored-by: RustamRu <kagapov.rustam@gmail.com>
Reviewed-on: #69
Reviewed-by: Primakov Alexandr Alexandrovich <primakovpro@gmail.com>
2025-02-02 15:11:59 +03:00
aa
c2784dcf45 Merge pull request 'gamehub' (#76) from gamehub into master
Reviewed-on: #76
2025-02-01 16:20:44 +03:00
64ed9b8eda Merge pull request 'kazan-explore culture quiz' (#84) from kazan-explore into master
Reviewed-on: #84
2025-02-01 15:18:40 +03:00
e9814f36bf kazan-explore culture quiz 2025-02-01 15:17:54 +03:00
0bd883df59 Merge pull request 'delete verification user' (#83) from sberhubproject into master
Reviewed-on: #83
2025-02-01 14:17:43 +03:00
1657b0c5e9 Merge pull request 'feat (connectme): add request for city' (#82) from connectme-request into master
Reviewed-on: #82
2025-02-01 14:15:36 +03:00
a9673b260f
delete verification user 2025-02-01 14:15:33 +03:00
aaeii
801f9ac1e3 new games-in-cart 2025-01-31 20:18:27 +03:00
aaeii
cbbb376fd6 update json gamehub: fix format 2025-01-25 23:24:34 +03:00
aaeii
faaec7c718 update json gamehub: fix price 2025-01-25 23:16:03 +03:00
16 changed files with 539 additions and 241 deletions

26
package-lock.json generated
View File

@ -25,6 +25,7 @@
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.12.0",
"mongoose": "^8.9.2",
"mongoose-sequence": "^6.0.1",
"morgan": "^1.10.0",
"pbkdf2-password": "^1.2.1",
"rotating-file-stream": "^3.2.5",
@ -2133,6 +2134,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/async": {
"version": "3.2.6",
"resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz",
"integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==",
"license": "MIT"
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
@ -5642,6 +5649,12 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
},
"node_modules/lodash.includes": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
@ -5995,6 +6008,19 @@
"url": "https://opencollective.com/mongoose"
}
},
"node_modules/mongoose-sequence": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/mongoose-sequence/-/mongoose-sequence-6.0.1.tgz",
"integrity": "sha512-uXnLCW9pu2V49Xw8BmdXdeRugd2mv+ntu3nT2Bbm33pNRmmvHE2GKA+8BASKoQt960McLX4VL78wkb492f6MoQ==",
"license": "GPL-2.0",
"dependencies": {
"async": "^3.2.5",
"lodash": "^4.17.21"
},
"peerDependencies": {
"mongoose": ">=5"
}
},
"node_modules/mongoose/node_modules/mongodb": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.12.0.tgz",

View File

@ -39,6 +39,7 @@
"jsonwebtoken": "^9.0.2",
"mongodb": "^6.12.0",
"mongoose": "^8.9.2",
"mongoose-sequence": "^6.0.1",
"morgan": "^1.10.0",
"pbkdf2-password": "^1.2.1",
"rotating-file-stream": "^3.2.5",

View File

@ -1,5 +1,6 @@
const { Schema, model } = require('mongoose')
const { orderStatus } = require('./const')
const { OrderNumberModel } = require('./order.number')
const schema = new Schema({
phone: {
@ -27,6 +28,10 @@ const schema = new Schema({
type: String,
required: true
},
orderNumber: {
type: String,
unique: true
},
status: {
type: String,
required: true,
@ -47,6 +52,18 @@ const schema = new Schema({
},
})
schema.pre('save', async function (next) {
if (this.isNew) {
const counter = await OrderNumberModel.findOneAndUpdate(
{ _id: 'orderNumber' },
{ $inc: { sequenceValue: 1 } },
{ new: true, upsert: true }
)
this.orderNumber = counter.sequenceValue.toString()
}
next()
})
schema.set('toJSON', {
virtuals: true,
versionKey: false,

View File

@ -0,0 +1,14 @@
const { Schema, model } = require('mongoose')
const schema = new Schema({
_id: {
type: String,
required: true,
},
sequenceValue: {
type: Number,
default: 0
}
})
exports.OrderNumberModel = model('dry-wash-order-number', schema)

View File

@ -9,7 +9,7 @@ router.get("/update-like", (request, response) => {
});
router.get("/categories", (request, response) => {
response.send(require("./json/categories/success.json"));
response.send(require("./json/home-page-data/all-games.json"));
});
router.get("/shopping-cart", (request, response) => {

View File

@ -1,186 +0,0 @@
{
"success": true,
"data": {
"games1": [
{
"id": 1,
"title": "How to Survive",
"price": 259,
"old_price": 500,
"image": "sales_game1",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 2,
"title": "Red Solstice 2 Survivors",
"price": 561,
"image": "sales_game2",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 3,
"title": "Sons Of The Forests",
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
],
"games2": [
{
"id": 7,
"title": "Alpha League",
"price": 299,
"image": "new_game1",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 8,
"title": "Sons Of The Forests",
"price": 820,
"old_price": 1100,
"image": "new_game2",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 9,
"title": "Pacific Drives",
"price": 1799,
"image": "new_game3",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
],
"games3": [
{
"id": 10,
"title": "Elden Ring",
"price": 3295,
"old_price": 3599,
"image": "leaders_game2",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 11,
"title": "Counter-Strike 2",
"price": 479,
"image": "leaders_game1",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 12,
"title": "PUBG: BATTLEGROUNDS",
"price": 199,
"image": "leaders_game3",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
"title": "The Witcher 3: Wild Hunt",
"price": 990,
"old_price": 1200,
"image": "leaders_game4",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
"title": "Atomic Heart",
"price": 1200,
"old_price": 2500,
"image": "leaders_game5",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
"title": "Crab Game",
"price": 600,
"old_price": 890,
"image": "leaders_game6",
"os": "windows",
"fav1": "star1",
"fav2": "star2"
}
]
}
}

View File

@ -5,7 +5,7 @@
{
"username": ользователь1",
"text": "Текст комментария 1",
"likes": 9,
"likes": 11,
"rating": 8,
"date": "2025-03-01T10:00:00Z"
},
@ -19,7 +19,7 @@
{
"username": ользователь3",
"text": "Текст комментария 3",
"likes": 5,
"likes": 2,
"rating": 3,
"date": "2025-02-01T10:00:00Z"
},

View File

@ -3,147 +3,197 @@
"data": [
{
"id": 1,
"name": "The Witcher 3: Wild Hunt",
"title": "The Witcher 3: Wild Hunt",
"image": "game1",
"text": "$10",
"price": 990,
"old_price": 1200,
"os": "windows",
"imgPath": "img_top_1",
"description": "Эпическая RPG с открытым миром, в которой Геральт из Ривии охотится на монстров и раскрывает политические заговоры.",
"category": "RPG"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 2,
"name": "Red Dead Redemption 2",
"title": "Red Dead Redemption 2",
"image": "game2",
"text": "$10",
"price": 980,
"old_price": 3800,
"os": "windows",
"imgPath": "img_top_2",
"description": "Приключенческая игра с открытым миром на Диком Западе, рассказывающая историю Артура Моргана.",
"category": "Adventures"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 3,
"name": "Forza Horizon 5",
"title": "Forza Horizon 5",
"image": "game3",
"text": "$10",
"price": 1900,
"os": "windows",
"imgPath": "img_top_3",
"description": "Гоночная игра с огромным открытым миром, действие которой происходит в Мексике.",
"category": "Race"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 4,
"name": "Atomic Heart",
"title": "Atomic Heart",
"image": "game4",
"text": "$10",
"price": 1200,
"old_price": 2500,
"os": "windows",
"imgPath": "img_top_4",
"description": "Экшен-шутер с элементами RPG, разворачивающийся в альтернативной Советской России.",
"category": "Shooters"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 5,
"name": "Counter-Strike 2",
"title": "Counter-Strike 2",
"image": "game5",
"text": "$10",
"price": 479,
"os": "windows",
"imgPath": "img_top_5",
"description": "Популярный онлайн-шутер с соревновательным геймплеем и тактическими элементами.",
"category": "Shooters"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 6,
"name": "Grand Theft Auto V",
"title": "Grand Theft Auto V",
"image": "game6",
"text": "$10",
"price": 700,
"os": "windows",
"imgPath": "img_top_6",
"description": "Игра с открытым миром, где можно погрузиться в криминальный мир Лос-Сантоса.",
"category": "Adventures"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 7,
"name": "Assassins Creed IV: Black Flag",
"title": "Assassins Creed IV: Black Flag",
"image": "game7",
"text": "$10",
"price": 1100,
"os": "windows",
"imgPath": "img_top_7",
"description": "Приключенческая игра о пиратах и морских сражениях в эпоху золотого века пиратства.",
"category": "Adventures"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 8,
"name": "Spider-Man",
"title": "Spider-Man",
"image": "game8",
"text": "$10",
"price": 3800,
"os": "windows",
"imgPath": "img_top_8",
"description": "Игра о супергерое Человеке-пауке с захватывающими битвами и паркуром по Нью-Йорку.",
"category": "Action"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 9,
"name": "Assassins Creed Mirage",
"title": "Assassins Creed Mirage",
"image": "game9",
"text": "$10",
"price": 1600,
"os": "windows",
"imgPath": "img_top_9",
"description": "Приключенческая игра с упором на скрытность, вдохновленная классическими частями серии.",
"category": "Action"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 10,
"name": "Assassins Creed Valhalla",
"title": "Assassins Creed Valhalla",
"image": "game10",
"text": "$10",
"price": 800,
"old_price": 2200,
"os": "windows",
"imgPath": "img_top_10",
"description": "RPG с открытым миром о викингах, включающая битвы, исследования и строительство поселений.",
"category": "RPG"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 11,
"name": "ARK: Survival Evolved",
"title": "ARK: Survival Evolved",
"image": "game11",
"text": "$10",
"price": 790,
"os": "windows",
"imgPath": "img_top_11",
"description": "Выживание в открытом мире с динозаврами, строительством и многопользовательскими элементами.",
"category": "Simulators"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 12,
"name": "FIFA 23",
"title": "FIFA 23",
"image": "game12",
"text": "$10",
"price": 3900,
"os": "windows",
"imgPath": "img_top_12",
"description": "Популярный футбольный симулятор с улучшенной графикой и реалистичным геймплеем.",
"category": "Sports"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 13,
"name": "Dirt 5",
"title": "Dirt 5",
"image": "game13",
"text": "$10",
"price": 2300,
"os": "windows",
"imgPath": "img_top_13",
"description": "Аркадная гоночная игра с фокусом на ралли и внедорожных соревнованиях.",
"category": "Race"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 14,
"name": "Cyberpunk 2077",
"title": "Cyberpunk 2077",
"image": "game14",
"text": "$10",
"price": 3400,
"os": "windows",
"imgPath": "img_top_14",
"description": "RPG в киберпанк-сеттинге с нелинейным сюжетом и детализированным открытым миром.",
"category": "RPG"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 15,
"name": "Age of Empires IV",
"title": "Age of Empires IV",
"image": "game15",
"text": "$10",
"price": 3200,
"os": "windows",
"imgPath": "img_top_15",
"description": "Классическая стратегия в реальном времени с историческими кампаниями.",
"category": "Strategies"
,"fav1": "star1",
"fav2": "star2"
},
{
"id": 16,
"name": "Civilization VI",
"title": "Civilization VI",
"image": "game16",
"text": "$10",
"price": 4200,
"os": "windows",
"imgPath": "img_top_16",
"description": "Глобальная пошаговая стратегия, в которой игроки строят и развивают цивилизации.",
"category": "Strategies"
}
]
}
}

View File

@ -0,0 +1,16 @@
{
"success": true,
"data": {
"ids": [
3,
13,
1,
10,
4,
9,
15,
6,
7
]
}
}

View File

@ -3,43 +3,51 @@
"data": {
"topSail": [
{
"id": 1,
"image": "game1",
"text": "$10",
"price": 1500,
"imgPath": "img_top_1"
},
{
"id": 2,
"image": "game2",
"text": "$10",
"price": 980,
"imgPath": "img_top_2"
},
{
"id": 3,
"image": "game3",
"text": "$10",
"price": 1900,
"imgPath": "img_top_3"
},
{
"id": 4,
"image": "game4",
"text": "$10",
"price": 1200,
"imgPath": "img_top_4"
},
{
"id": 5,
"image": "game5",
"text": "$10",
"price": 479,
"imgPath": "img_top_5"
},
{
"id": 6,
"image": "game6",
"text": "$10",
"price": 700,
"imgPath": "img_top_6"
},
{
"id": 7,
"image": "game7",
"text": "$10",
"price": 1100,
"imgPath": "img_top_7"
},
{
"id": 8,
"image": "game8",
"text": "$10",
"price": 3800,
"imgPath": "img_top_8"
}
],

View File

@ -788,5 +788,121 @@
"image_url": "w_six"
}
]
},
"history": {
"intro_text": "Let's see how well you know UNICS!",
"intro_image": "culture",
"questions": [
{
"question": "When was Kazan founded?",
"options": [
"1005",
"1156",
"1230",
"1323"
],
"correct_answer": "1005",
"image_url": "culture"
},
{
"question": "What is the main river flowing through Kazan?",
"options": [
"Volga",
"Kazanka",
"Kama",
"Izh"
],
"correct_answer": "Kazanka",
"image_url": "culture"
},
{
"question": "Who was the first khan of Kazan?",
"options": [
"Ulugh Muhammad",
"Akhmat",
"Shah Ali",
"Mamuka"
],
"correct_answer": "Ulugh Muhammad",
"image_url": "culture"
},
{
"question": "What is the name of Kazan's main sports complex where the 2013 Universiade was held?",
"options": [
"Kazan Arena",
"Tatneft Arena",
"Bugulma Arena",
"Ak Bars Sports Palace"
],
"correct_answer": "Kazan Arena",
"image_url": "culture"
},
{
"question": "Which mosque in Kazan is considered one of the largest in Russia?",
"options": [
"Kul Sharif Mosque",
"Mari El Mosque",
"Aisha Mosque",
"Imam Muhammad Mosque"
],
"correct_answer": "Kul Sharif Mosque",
"image_url": "culture"
},
{
"question": "What is the name of the square where the Kazan Kremlin and Kul Sharif Mosque are located?",
"options": [
"Vakhitov Square",
"Freedom Square",
"Kremlin Square",
"Revolution Square"
],
"correct_answer": "Kremlin Square",
"image_url": "culture"
},
{
"question": "What symbol of Kazan is depicted on the city's coat of arms?",
"options": [
"Dragon",
"Tiger",
"Lion",
"Eagle"
],
"correct_answer": "Dragon",
"image_url": "culture"
},
{
"question": "Who was the architect of the Kazan Kremlin?",
"options": [
"Ivan Zarudny",
"Fyodor Benjamin",
"Andrey Ushakov",
"Yury Dashevsky"
],
"correct_answer": "Andrey Ushakov",
"image_url": "culture"
},
{
"question": "Which of these universities is located in Kazan?",
"options": [
"Moscow State University",
"Kazan Federal University",
"St. Petersburg Polytechnic University",
"Novosibirsk State University"
],
"correct_answer": "Kazan Federal University",
"image_url": "culture"
},
{
"question": "What is the name of the largest street in Kazan, which is also the center of the city's nightlife?",
"options": [
"Kremlin Street",
"Bauman Street",
"Pushkin Street",
"Kayum Nasyri Street"
],
"correct_answer": "Bauman Street",
"image_url": "culture"
}
]
}
}

View File

@ -788,5 +788,121 @@
"image_url": "w_six"
}
]
},
"history": {
"intro_text": "Давайте узнаем, насколько вы хорошо знаете историю Казани!",
"intro_image": "culture",
"questions": [
{
"question": "Когда Казань была основана?",
"options": [
"1000 год",
"1156 год",
"1230 год",
"1323 год"
],
"correct_answer": "1000 год",
"image_url": "culture"
},
{
"question": "Как называется главная река, протекающая через Казань?",
"options": [
"Волга",
"Казанка",
"Кама",
"Иж"
],
"correct_answer": "Казанка",
"image_url": "culture"
},
{
"question": "Кто был первым казанским ханом?",
"options": [
"Улу-Мухаммед",
"Ахмат",
"Шах-Али",
"Мамука"
],
"correct_answer": "Улу-Мухаммед",
"image_url": "culture"
},
{
"question": "Как называется главный спортивный комплекс Казани, где проводились Универсиада 2013 года?",
"options": [
"Казан Арена",
"Татнефть Арена",
"Бугульминская арена",
"Дворец спорта \"Ак Барс\""
],
"correct_answer": "Казан Арена",
"image_url": "culture"
},
{
"question": "Какая мечеть в Казани считается одной из самых больших в России?",
"options": [
"Мечеть Кул Шариф",
"Мечеть Марий Эл",
"Мечеть Айша",
"Мечеть имама Мухаммада"
],
"correct_answer": "Мечеть Кул Шариф",
"image_url": "culture"
},
{
"question": "Как называется площадь, на которой расположены Казанский Кремль и мечеть Кул Шариф?",
"options": [
"Площадь Вахитова",
"Площадь Свободы",
"Площадь Кремля",
"Площадь Революции"
],
"correct_answer": "Площадь Кремля",
"image_url": "culture"
},
{
"question": "Какой символ Казани изображён на гербе города?",
"options": [
"Дракон",
"Тигр",
"Лев",
"Орел"
],
"correct_answer": "Дракон",
"image_url": "culture"
},
{
"question": "Какой архитектор спроектировал Казанский Кремль?",
"options": [
"Иван Зарудный",
"Фёдор Бенжамин",
"Андрей Ушаков",
"Юрий Дашевский"
],
"correct_answer": "Андрей Ушаков",
"image_url": "culture"
},
{
"question": "Какой из этих вузов находится в Казани?",
"options": [
"Московский государственный университет",
"Казанский федеральный университет",
"Санкт-Петербургский политехнический университет",
"Новосибирский государственный университет"
],
"correct_answer": "Казанский федеральный университет",
"image_url": "culture"
},
{
"question": "Как называется крупнейшая в Казани улица, которая также является центром ночной жизни города?",
"options": [
"Кремлевская улица",
"Баумана улица",
"Пушкина улица",
"Каюма Насыри улица"
],
"correct_answer": "Баумана улица",
"image_url": "culture"
}
]
}
}

View File

@ -788,5 +788,121 @@
"image_url": "w_six"
}
]
},
"history": {
"intro_text": "Әйдәгез, Казан тарихын белүегезне ачыклыйк!",
"intro_image": "culture",
"questions": [
{
"question": "Казан кайчан нигезләнгән?",
"options": [
"1000 ел",
"1156 ел",
"1230 ел",
"1323 ел"
],
"correct_answer": "1000 ел",
"image_url": "culture"
},
{
"question": "Казан аша агучы төп елга ничек атала?",
"options": [
"Идел",
"Казанка",
"Кама",
"Иж"
],
"correct_answer": "Казанка",
"image_url": "culture"
},
{
"question": "Казанның беренче ханы кем булган?",
"options": [
"Олуг Мөхәммәт",
"Әхмәт",
"Шаһ-Әли",
"Мамука"
],
"correct_answer": "Олуг Мөхәммәт",
"image_url": "culture"
},
{
"question": "2013 елда Универсиада узган Казанның төп спорт комплексы ничек атала?",
"options": [
"Казан Арена",
"Татнефть Арена",
"Бөгелмә Арена",
"Ак Барс спорт сарае"
],
"correct_answer": "Казан Арена",
"image_url": "culture"
},
{
"question": "Казандагы иң зур мәчетләрнең берсе Россиядәге кайсысы?",
"options": [
"Кол Шәриф мәчете",
"Марий Эл мәчете",
"Айша мәчете",
"Имам Мөхәммәт мәчете"
],
"correct_answer": "Кол Шәриф мәчете",
"image_url": "culture"
},
{
"question": "Казан Кремле һәм Кол Шәриф мәчете урнашкан мәйдан ничек атала?",
"options": [
"Вахитов мәйданы",
"Ирек мәйданы",
"Кремль мәйданы",
"Революция мәйданы"
],
"correct_answer": "Кремль мәйданы",
"image_url": "culture"
},
{
"question": "Казан гербында кайсы символ сурәтләнгән?",
"options": [
"Аждаһа",
"Юлбарыс",
"Арслан",
"Бүре"
],
"correct_answer": "Аждаһа",
"image_url": "culture"
},
{
"question": "Казан Кремленең архитекторын атагыз.",
"options": [
"Иван Зарудный",
"Фёдор Бенжамин",
"Андрей Ушаков",
"Юрий Дашевский"
],
"correct_answer": "Андрей Ушаков",
"image_url": "culture"
},
{
"question": "Бу югары уку йортларының кайсысы Казанда урнашкан?",
"options": [
"Мәскәү дәүләт университеты",
"Казан федераль университеты",
"Санкт-Петербург политехник университеты",
"Новосибирск дәүләт университеты"
],
"correct_answer": "Казан федераль университеты",
"image_url": "culture"
},
{
"question": "Казандагы иң зур урам ничек атала? Ул шулай ук шәһәрнең төнге тормыш үзәге булып тора.",
"options": [
"Кремль урамы",
"Бауман урамы",
"Пушкин урамы",
"Каюм Насыйри урамы"
],
"correct_answer": "Бауман урамы",
"image_url": "culture"
}
]
}
}

View File

@ -27,10 +27,12 @@ router.post('/:user_id/:action/:id', (req, res) => {
const user_id = parseInt(req.params.user_id);
const id = parseInt(req.params.id);
const action = req.params.action;
/*
if (users_data.findIndex((item) => item.id === user_id) === -1 || data.findIndex((item) => item.id === id) === -1) {
res.status(404).send();
return;
}
*/
if (action !== 'participate' && action !== 'refuse') {
res.status(400).send({ error: 'Invalid action' });
return;

View File

@ -10,6 +10,17 @@
"Музыка"
]
},
{
"id": 1252744945,
"username": "Моряков Сергей",
"photo": "",
"about": "Люблю путешествия и фотографию, обожаю изучать новые культуры.",
"email": "sergey.moryakov@example.com",
"interests": [
"Путешествия и туризм",
"Искусство, фотография и дизайн"
]
},
{
"id": 2,
"username": "Мария Смирнова",
@ -218,16 +229,5 @@
"Медицина и здоровье",
"Спорт, фитнес и ЗОЖ"
]
},
{
"id": 1252744945,
"username": "Моряков Сергей",
"photo": "https://i.pravatar.cc/150?img=50",
"about": "Люблю путешествия и фотографию, обожаю изучать новые культуры.",
"email": "maria.smirnova@example.com",
"interests": [
"Путешествия и туризм",
"Искусство, фотография и дизайн"
]
}
]

View File

@ -27,10 +27,12 @@ router.post('/:to_id/:action/:from_id', (req, res) => {
const to_id = parseInt(req.params.to_id);
const from_id = parseInt(req.params.from_id);
const action = req.params.action;
/*
if (data.findIndex((item) => item.id === to_id) === -1 || data.findIndex((item) => item.id === from_id) === -1) {
res.status(404).send();
return;
}
*/
if (action !== 'like' && action !== 'dislike') {
res.status(400).send({ error: 'Invalid action' });
return;