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'
|
'use server'
|
||||||
|
|
||||||
export async function getAlbums() {
|
export async function getAlbums() {
|
||||||
return await fetch("https://api.anatid.net/album", {
|
return await fetch('https://api.anatid.net/album');
|
||||||
method: "GET",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getAlbum(id: number) {
|
export async function getAlbum(id: number) {
|
||||||
@ -58,10 +55,7 @@ export async function deleteAlbum(formData: FormData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getSongs() {
|
export async function getSongs() {
|
||||||
return await fetch(`https://api.anatid.net/song/`, {
|
return await fetch("https://api.anatid.net/song/");
|
||||||
method: "GET",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getSong(id: number) {
|
export async function getSong(id: number) {
|
||||||
|
@ -20,9 +20,13 @@ export default function Page() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchAlbum(id: string) {
|
async function fetchAlbum(id: string) {
|
||||||
|
try {
|
||||||
const response = await getAlbum(parseInt(id));
|
const response = await getAlbum(parseInt(id));
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
setAlbum(data);
|
setAlbum(data);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error getting album with id ${id}`, error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fetchAlbum(id);
|
fetchAlbum(id);
|
||||||
}, [id]);
|
}, [id]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user