Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Install Packages
run: npm ci
- name: Build Vite & TSC
run: npm run build
run: npm run build
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"javascript.format.semicolons": "remove",
"typescript.format.semicolons": "remove",
"autoimport.useSemiColon": false,


"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# OSC Jukebox React App

[![Code Linting](https://github.com/ufosc/Jukebox-Frontend/actions/workflows/code-linting.yml/badge.svg)](https://github.com/ufosc/Jukebox-Frontend/actions/workflows/code-linting.yml)
[![Unit Tests](https://github.com/ufosc/Jukebox-Frontend/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/ufosc/Jukebox-Frontend/actions/workflows/unit-tests.yml)

Expand Down Expand Up @@ -127,16 +128,19 @@ Here's how you can get involved in contributing to our project:
Aftering forking the repo and cloning your fork to your local system,

1. Create a new branch for your feature or fix

```sh
git checkout -b feature/your-feature-name
```

2. Make your changes and commit them with clear, concise messages

```sh
git commit -m "Add: feature description"
```

3. Push your branch to your fork

```sh
git push origin feature/your-feature-name
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"network": "vite --mode network --no-open",
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "eslint 'src/**/*.{ts,tsx}'",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:fix": "npm run lint -- --fix",
"format": "prettier --check --log-level warn \"src/**/*.{jsx,js,ts,tsx}\"",
"format:fix": "prettier --write --log-level warn \"src/**/*.{jsx,js,ts,tsx}\"",
Expand Down
23 changes: 15 additions & 8 deletions src/api/ApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,22 @@ export class ApiClient extends ApiAuth {
albumName: string,
artistName: string,
) {
const url = this.endpoints.jukebox.search(jukeboxId)
const params = {
jukeboxId: jukeboxId,
track: trackName,
album: albumName,
artist: artistName,
}
const qp = new URLSearchParams()
Object.entries(params).forEach(([k, v]) => qp.append(k, String(v)))

const response = await this.post<{ tracks: ITrack[] }>(url, {
body: {
trackQuery: trackName,
albumQuery: albumName,
artistQuery: artistName,
},
})
let url = this.endpoints.jukebox.search(jukeboxId)

url = `${url}?${qp.toString()}`

console.log(url)

const response = await this.get<{ tracks: ITrack[] }>(url)

return response
}
Expand Down
Loading