Browse Source
Update backend/app/controllers/user.controller.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
features/create-channel
Sacha GUERIN
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
1 deletions
-
backend/app/controllers/user.controller.js
|
|
@ -248,7 +248,7 @@ export async function getHistory(req, res) { |
|
|
for (const video of result.rows) { |
|
|
for (const video of result.rows) { |
|
|
// GET VIDEO VIEW COUNT
|
|
|
// GET VIDEO VIEW COUNT
|
|
|
const videoQuery = `SELECT COUNT(*) as view_count FROM history WHERE video = $1`; |
|
|
const videoQuery = `SELECT COUNT(*) as view_count FROM history WHERE video = $1`; |
|
|
const videoResult = await client.query(videoQuery, [video.channel]); |
|
|
const videoResult = await client.query(videoQuery, [video.id]); |
|
|
const videoToAdd = { |
|
|
const videoToAdd = { |
|
|
title: video.title, |
|
|
title: video.title, |
|
|
thumbnail: video.thumbnail, |
|
|
thumbnail: video.thumbnail, |
|
|
|