Skip to content

Commit

Permalink
Get params in query API.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitkonikov committed Feb 10, 2024
1 parent 7faee8c commit 2f7bf64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/routers/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import Site from '../models/site.js';

const router = express.Router();

router.get('/playlists', async (req, res) => {
router.get('/playlists/:site', async (req, res) => {
try {
const { site } = req.body;
const { site } = req.params;

const siteDoc = await Site.findOne({ name: site });

Expand All @@ -30,9 +30,9 @@ router.get('/playlists', async (req, res) => {
}
});

router.get('/films', async (req, res) => {
router.get('/films/:playlist', async (req, res) => {
try {
const { playlist } = req.body;
const { playlist } = req.params;

const playlistDoc = await Playlist.findOne({ name: playlist });

Expand Down

0 comments on commit 2f7bf64

Please sign in to comment.