Changing to Number casts
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 36s
Music Collection CI Workflow / test (./frontend) (push) Successful in 37s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 54s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m50s
Music Collection CI Workflow / deploy (push) Successful in 23s
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 36s
Music Collection CI Workflow / test (./frontend) (push) Successful in 37s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 54s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m50s
Music Collection CI Workflow / deploy (push) Successful in 23s
This commit is contained in:
parent
435d4c4825
commit
22c6bea333
@ -3,9 +3,13 @@ Music Collection is a demo app with a frontend written in NextJS, and the backen
|
|||||||
|
|
||||||
## Frontend
|
## Frontend
|
||||||
The frontend app can be accessed at [https://music.anatid.net/album](https://music.anatid.net/album), showing a list of Albums added through the app.
|
The frontend app can be accessed at [https://music.anatid.net/album](https://music.anatid.net/album), showing a list of Albums added through the app.
|
||||||
|
|
||||||
Clicking on the (+) symbol will allow the user to add an Album with the attributes of Album Title, Artist and Genre.
|
Clicking on the (+) symbol will allow the user to add an Album with the attributes of Album Title, Artist and Genre.
|
||||||
|
|
||||||
Each Album listed also has controls for editing and deleting. (TODO: Add dialog to warn of deletion).
|
Each Album listed also has controls for editing and deleting. (TODO: Add dialog to warn of deletion).
|
||||||
|
|
||||||
Clicking on the Album Title will allow the user to view the full track list, showing each Songs Title, Duration and Track number. The user can also add, edit or delete each Song. (TODO: Add dialog to warn of deletion).
|
Clicking on the Album Title will allow the user to view the full track list, showing each Songs Title, Duration and Track number. The user can also add, edit or delete each Song. (TODO: Add dialog to warn of deletion).
|
||||||
|
|
||||||
Messages from the API are returned to the user via a Toast style pop-up.
|
Messages from the API are returned to the user via a Toast style pop-up.
|
||||||
(TODO: Authentication, User Accounts)
|
(TODO: Authentication, User Accounts)
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ export async function createAlbum(formData: FormData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updateAlbum(formData: FormData) {
|
export async function updateAlbum(formData: FormData) {
|
||||||
const id = parseInt(formData.get('id'));
|
const id = Number(formData.get('id'));
|
||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const artist = formData.get('artist');
|
const artist = formData.get('artist');
|
||||||
const genre = formData.get('genre');
|
const genre = formData.get('genre');
|
||||||
@ -154,10 +154,10 @@ export async function getSong(id: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function createSong(formData: FormData) {
|
export async function createSong(formData: FormData) {
|
||||||
const albumId = parseInt(formData.get('albumId'));
|
const albumId = Number(formData.get('albumId'));
|
||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const duration = parseInt(formData.get('duration'));
|
const duration = Number(formData.get('duration'));
|
||||||
const trackNumber = parseInt(formData.get('trackNumber'));
|
const trackNumber = Number(formData.get('trackNumber'));
|
||||||
return fetch("https://api.anatid.net/song/", {
|
return fetch("https://api.anatid.net/song/", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
@ -178,11 +178,11 @@ export async function createSong(formData: FormData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updateSong(formData: FormData) {
|
export async function updateSong(formData: FormData) {
|
||||||
const id = parseInt(formData.get('id'));
|
const id = Number(formData.get('id'));
|
||||||
const albumId = parseInt(formData.get('albumId'));
|
const albumId = Number(formData.get('albumId'));
|
||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const duration = parseInt(formData.get('duration'));
|
const duration = Number(formData.get('duration'));
|
||||||
const trackNumber = parseInt(formData.get('trackNumber'));
|
const trackNumber = Number(formData.get('trackNumber'));
|
||||||
return fetch(`https://api.anatid.net/song/${id}`, {
|
return fetch(`https://api.anatid.net/song/${id}`, {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user