Skip to content

Commit

Permalink
Fixed param bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Exerra committed Oct 22, 2021
1 parent c4a4aa7 commit d96d34a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const jwt = require('jsonwebtoken')
const axios = require('axios')

const { createJWT } = require("../../modules/createJWT")
const { createJWT } = require("../modules/createJWT")

const rootPath = "https://api.music.apple.com/v1"
let token
Expand Down Expand Up @@ -57,11 +57,11 @@ class MusicKit {
*/
search(storefront, type, searchquery, cb, limit = 1) {

if (!country || !type || !searchquery || !cb) {
if (!storefront || !type || !searchquery || !cb) {
throw new Error("At least one required parameter is missing. Find out about how to use the search function in https://musickit.js.org/#/catalog/functions/search")
}

let reqUrl = `${rootPath}/catalog/${country}/search`
let reqUrl = `${rootPath}/catalog/${storefront}/search`

axios({
"method": "GET",
Expand Down

0 comments on commit d96d34a

Please sign in to comment.