Compare commits
No commits in common. "master" and "v1.3.0" have entirely different histories.
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker stop $(docker ps -q)
|
||||
docker volume remove red_coder_volume
|
||||
docker volume create red_coder_volume
|
||||
docker run --rm -v red_coder_volume:/data/db -p 27017:27017 -d mongo:4.4.13
|
||||
docker volume remove multy_stub_volume
|
||||
docker volume create multy_stub_volume
|
||||
docker run --rm -v multy_stub_volume:/data/db -p 27017:27017 -d mongo
|
||||
|
7571
package-lock.json
generated
7571
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "red-coder-bh",
|
||||
"version": "1.3.3",
|
||||
"version": "1.3.0",
|
||||
"description": "",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"start": "cross-env MODE=\"dev\" nodemon",
|
||||
"start": "nodemon",
|
||||
"build": "tsc",
|
||||
"up:prod": "node dist/src/main",
|
||||
"deploy:d:stop": "docker-compose down",
|
||||
|
@ -1,11 +1,10 @@
|
||||
import express from 'express'
|
||||
import cookieSession from 'cookie-session'
|
||||
import cors from 'cors'
|
||||
|
||||
import './config'
|
||||
import { errorHandle } from './utils/error-handling'
|
||||
import { router } from './routes'
|
||||
import './mailer'
|
||||
import cors from 'cors'
|
||||
|
||||
const app = express()
|
||||
|
||||
|
@ -17,40 +17,3 @@ router.use(bannerRouter)
|
||||
router.use('/v1/auth', authRouter)
|
||||
router.use(['/v1/tasks', '/v1/task'], jwtMiddlevare, tasksRouter)
|
||||
router.use('/v1/drafts', jwtMiddlevare, draftsRouter)
|
||||
|
||||
const charLikes = {}
|
||||
|
||||
router.get('/likes', (req, res) => {
|
||||
res.set({
|
||||
'Access-Control-Allow-Origin': 'http://admin.inno-js.ru',
|
||||
})
|
||||
res.send({
|
||||
likes: charLikes,
|
||||
})
|
||||
})
|
||||
|
||||
router.post('/toggle-like', (req, res) => {
|
||||
const { id, charId } = req.body
|
||||
|
||||
if (charLikes[charId]) {
|
||||
const currentLikes = new Set(charLikes[charId].likes)
|
||||
|
||||
if (currentLikes.has(id)) {
|
||||
currentLikes.delete(id)
|
||||
} else {
|
||||
currentLikes.add(id)
|
||||
}
|
||||
|
||||
charLikes[charId].likes = [...currentLikes]
|
||||
} else {
|
||||
charLikes[charId] = { likes: [id] }
|
||||
}
|
||||
|
||||
res.set({
|
||||
'Access-Control-Allow-Origin': 'http://admin.inno-js.ru',
|
||||
})
|
||||
res.send({
|
||||
likes: charLikes,
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import baseAxios from 'axios'
|
||||
|
||||
export const adminAxios = baseAxios.create({
|
||||
baseURL: `http://${process.env.ADMIN_SERVER_BASE_NAME}/api/out/v2`,
|
||||
baseURL: `http://${process.env.ADMIN_SERVER_BASE_NAME}/api/out`,
|
||||
method: 'POST',
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user