Reworking actions
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 21s
Music Collection CI Workflow / test (./frontend) (push) Successful in 27s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/msuic-collection-backend, ./backend) (push) Successful in 48s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m42s
Music Collection CI Workflow / deploy (push) Successful in 23s
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 21s
Music Collection CI Workflow / test (./frontend) (push) Successful in 27s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/msuic-collection-backend, ./backend) (push) Successful in 48s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m42s
Music Collection CI Workflow / deploy (push) Successful in 23s
This commit is contained in:
parent
5184d8f641
commit
26a68ecc4a
@ -1,10 +1,7 @@
|
||||
'use server'
|
||||
|
||||
export async function getAlbums() {
|
||||
return await fetch("https://api.anatid.net/album", {
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
return await fetch('https://api.anatid.net/album');
|
||||
}
|
||||
|
||||
export async function getAlbum(id: number) {
|
||||
@ -58,10 +55,7 @@ export async function deleteAlbum(formData: FormData) {
|
||||
}
|
||||
|
||||
export async function getSongs() {
|
||||
return await fetch(`https://api.anatid.net/song/`, {
|
||||
method: "GET",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
return await fetch("https://api.anatid.net/song/");
|
||||
}
|
||||
|
||||
export async function getSong(id: number) {
|
||||
|
@ -20,9 +20,13 @@ export default function Page() {
|
||||
|
||||
useEffect(() => {
|
||||
async function fetchAlbum(id: string) {
|
||||
const response = await getAlbum(parseInt(id));
|
||||
const data = await response.json();
|
||||
setAlbum(data);
|
||||
try {
|
||||
const response = await getAlbum(parseInt(id));
|
||||
const data = await response.json();
|
||||
setAlbum(data);
|
||||
} catch (error) {
|
||||
console.error(`Error getting album with id ${id}`, error);
|
||||
}
|
||||
}
|
||||
fetchAlbum(id);
|
||||
}, [id]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user