Cleanup
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 37s
Music Collection CI Workflow / test (./frontend) (push) Successful in 39s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 53s
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 24s

This commit is contained in:
Phill Pover 2025-04-07 12:51:20 +01:00
parent 7a086b7575
commit 085f76bbcb
3 changed files with 23 additions and 12 deletions

View File

@ -18,6 +18,7 @@ Swagger Docs are available at [https://api.anatid.net/api](https://api.anatid.ne
The frontend and backend are built as Docker Images, running with Docker Compose behind a Swag based reverse proxy to enable SSL provided by LetsEncrypt, with the API suppored by a Postgres database for persistence. The frontend and backend are built as Docker Images, running with Docker Compose behind a Swag based reverse proxy to enable SSL provided by LetsEncrypt, with the API suppored by a Postgres database for persistence.
```
services: services:
music-collection-frontend: music-collection-frontend:
image: git.anatid.net/tabris/music-collection-frontend:main image: git.anatid.net/tabris/music-collection-frontend:main
@ -90,7 +91,7 @@ networks:
external: false external: false
frontend: frontend:
external: false external: false
```
## Repository ## Repository
The code can be found at [https://git.anatid.net/tabris/music-collection](https://git.anatid.net/tabris/music-collection), and is continuously deployed to the Docker network on commit by a pipeline Runner. The code can be found at [https://git.anatid.net/tabris/music-collection](https://git.anatid.net/tabris/music-collection), and is continuously deployed to the Docker network on commit by a pipeline Runner.

View File

@ -51,17 +51,27 @@ export default function Page() {
const formData = new FormData(event.currentTarget); const formData = new FormData(event.currentTarget);
try { try {
if (formData.get('id') == "") { if (formData.get('id') == "") {
await createSong(formData); await createSong(formData).then(response => {
handleSnackbar(`Successfully created Song with ID ${formData.get("id")}`, true); if (response.ok) {
handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true);
}
handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false);
})
.catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);});
} else { } else {
await updateSong(formData); await updateSong(formData).then(response => {
handleSnackbar(`Successfully updated Song with ID ${formData.get("id")}`, true); if (response.ok) {
handleSnackbar(`Successfully created Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, true);
}
handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(response)}`, false);
})
.catch(error => {handleSnackbar(`Failed to create Song with ID ${formData.get("id")}: ${JSON.stringify(error)}`, false);});
} }
revalidateAlbum(); revalidateAlbum();
const data = await getAlbum(parseInt(albumId)); const data = await getAlbum(parseInt(albumId));
setAlbum(data); setAlbum(data);
} catch (error) { } catch (error) {
handleSnackbar(`Error creating Song: ${error}`, false); handleSnackbar(`Error creating Song: ${JSON.stringify(error)}`, false);
} }
} }
@ -90,7 +100,7 @@ export default function Page() {
setFormSongTrackNumber(data.trackNumber); setFormSongTrackNumber(data.trackNumber);
handleShow(); handleShow();
} catch (error) { } catch (error) {
handleSnackbar(`Error getting song with ID ${songId}: ${error}`, false); handleSnackbar(`Error getting song with ID ${songId}: ${JSON.stringify(error)}`, false);
} }
} else { } else {
handleSnackbar(`Couldn't get ID of clicked element`, false); handleSnackbar(`Couldn't get ID of clicked element`, false);
@ -104,7 +114,7 @@ export default function Page() {
try { try {
await deleteSong(parseInt(songId)); await deleteSong(parseInt(songId));
} catch (error) { } catch (error) {
handleSnackbar(`Error deleting song with ID ${songId}: ${error}`, false); handleSnackbar(`Error deleting song with ID ${songId}: ${JSON.stringify(error)}`, false);
} }
revalidateAlbum(); revalidateAlbum();
const data = await getAlbum(parseInt(albumId)); const data = await getAlbum(parseInt(albumId));

View File

@ -33,7 +33,7 @@ export default function Page() {
const data = await getAlbums(); const data = await getAlbums();
setAlbums(data); setAlbums(data);
} catch (error) { } catch (error) {
handleSnackbar(`Error getting albums: ${error}`, false); handleSnackbar(`Error getting albums: ${JSON.stringify(error)}`, false);
} }
} }
fetchAlbums(); fetchAlbums();
@ -68,7 +68,7 @@ export default function Page() {
const data = await getAlbums(); const data = await getAlbums();
setAlbums(data); setAlbums(data);
} catch (error) { } catch (error) {
handleSnackbar(`Error creating Album: ${error}`, false); handleSnackbar(`Error creating Album: ${JSON.stringify(error)}`, false);
} }
} }
@ -95,7 +95,7 @@ export default function Page() {
setFormAlbumGenre(data.genre); setFormAlbumGenre(data.genre);
handleShow(); handleShow();
} catch (error) { } catch (error) {
handleSnackbar(`Error getting Album with ID ${id}: ${error}`, false); handleSnackbar(`Error getting Album with ID ${id}: ${JSON.stringify(error)}`, false);
} }
} else { } else {
handleSnackbar(`Couldn't get ID of clicked element`, false); handleSnackbar(`Couldn't get ID of clicked element`, false);
@ -109,7 +109,7 @@ export default function Page() {
await deleteAlbum(parseInt(id)); await deleteAlbum(parseInt(id));
handleSnackbar(`Successfully deleted Album with ID ${id}`, true); handleSnackbar(`Successfully deleted Album with ID ${id}`, true);
} catch (error) { } catch (error) {
handleSnackbar(`Error deleting Album with ID ${id}: ${error}`, false); handleSnackbar(`Error deleting Album with ID ${id}: ${JSON.stringify(error)}`, false);
} }
revalidateAlbums(); revalidateAlbums();
const data = await getAlbums(); const data = await getAlbums();