Parsing ints
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Successful in 35s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 55s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Failing after 1m29s
Music Collection CI Workflow / deploy (push) Has been skipped
Some checks failed
Music Collection CI Workflow / test (./backend) (push) Successful in 35s
Music Collection CI Workflow / test (./frontend) (push) Successful in 38s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 55s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Failing after 1m29s
Music Collection CI Workflow / deploy (push) Has been skipped
This commit is contained in:
parent
6222d2f8e2
commit
435d4c4825
@ -77,7 +77,7 @@ export async function createAlbum(formData: FormData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function updateAlbum(formData: FormData) {
|
export async function updateAlbum(formData: FormData) {
|
||||||
const id = formData.get('id');
|
const id = parseInt(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 = formData.get('albumId');
|
const albumId = parseInt(formData.get('albumId'));
|
||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const duration = formData.get('duration');
|
const duration = parseInt(formData.get('duration'));
|
||||||
const trackNumber = formData.get('trackNumber');
|
const trackNumber = parseInt(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 = formData.get('id');
|
const id = parseInt(formData.get('id'));
|
||||||
const albumId = formData.get('albumId');
|
const albumId = parseInt(formData.get('albumId'));
|
||||||
const title = formData.get('title');
|
const title = formData.get('title');
|
||||||
const duration = formData.get('duration');
|
const duration = parseInt(formData.get('duration'));
|
||||||
const trackNumber = formData.get('trackNumber');
|
const trackNumber = parseInt(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