Commit 0fd51a75 authored by Цой Данил's avatar Цой Данил 💬

#5 added token to headers

parent 46c9c424
*
!.gitignore
\ No newline at end of file
...@@ -8,7 +8,7 @@ import { EStatuses } from "../enum/EStatuses"; ...@@ -8,7 +8,7 @@ import { EStatuses } from "../enum/EStatuses";
const storage = multer.diskStorage({ const storage = multer.diskStorage({
destination(req, file, callback){ destination(req, file, callback){
callback(null, config.filePath) callback(null, config.filePath + '/albums')
}, },
filename(req, file, callback){ filename(req, file, callback){
callback(null, shortid.generate() + path.extname(file.originalname)) callback(null, shortid.generate() + path.extname(file.originalname))
......
...@@ -8,7 +8,7 @@ import { EStatuses } from "../enum/EStatuses"; ...@@ -8,7 +8,7 @@ import { EStatuses } from "../enum/EStatuses";
const storage = multer.diskStorage({ const storage = multer.diskStorage({
destination(req, file, callback){ destination(req, file, callback){
callback(null, config.filePath) callback(null, config.filePath + '/artists')
}, },
filename(req, file, callback){ filename(req, file, callback){
callback(null, shortid.generate() + path.extname(file.originalname)) callback(null, shortid.generate() + path.extname(file.originalname))
......
...@@ -17,7 +17,7 @@ export class TrackHistoriesController { ...@@ -17,7 +17,7 @@ export class TrackHistoriesController {
} }
private addTrackHistory = async (req: Request, res: Response): Promise<void> => { private addTrackHistory = async (req: Request, res: Response): Promise<void> => {
const trackHistoryDto: ITrackHistoryDto = req.body const trackHistoryDto: ITrackHistoryDto = {...req.body, token: req.headers.token}
const response = await this.service.addTrackHistory(trackHistoryDto) const response = await this.service.addTrackHistory(trackHistoryDto)
if (response.status === EStatuses.FAILURE){ if (response.status === EStatuses.FAILURE){
res.status(200).send(response) res.status(200).send(response)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment