aboutsummaryrefslogtreecommitdiffstats
path: root/pages/api/youtube/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'pages/api/youtube/search.js')
-rw-r--r--pages/api/youtube/search.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/pages/api/youtube/search.js b/pages/api/youtube/search.js
index b17d008..f1b461f 100644
--- a/pages/api/youtube/search.js
+++ b/pages/api/youtube/search.js
@@ -12,9 +12,14 @@ export default withSession(async (req, res) => {
throw new Error('Something went wrong')
}
- const video = await youtube.search(quote)
+ const results = await youtube.search(quote[0], {
+ ...quote[1],
+ requestOptions: {
+ headers: { 'Accept-Language': user.language || 'en' }
+ }
+ })
- res.status(200).json(video)
+ res.status(200).json(results)
} catch (error) {
res.status(400).json([])
}