Adding a isblank check
All checks were successful
Music Collection CI Workflow / test (./backend) (push) Successful in 29s
Music Collection CI Workflow / test (./frontend) (push) Successful in 35s
Music Collection CI Workflow / build-and-push-images (./backend/Dockerfile, git.anatid.net/tabris/music-collection-backend, ./backend) (push) Successful in 50s
Music Collection CI Workflow / build-and-push-images (./frontend/Dockerfile, git.anatid.net/tabris/music-collection-frontend, ./frontend) (push) Successful in 1m45s
Music Collection CI Workflow / deploy (push) Successful in 24s

This commit is contained in:
Phill Pover 2025-04-07 02:16:11 +01:00
parent 27be45b284
commit 5b6a6004da
3 changed files with 35 additions and 37 deletions

View File

@ -46,7 +46,7 @@ export default function Page() {
const formData = new FormData(event.currentTarget); const formData = new FormData(event.currentTarget);
try { try {
if (StringUtils.isBlank(formData.get('id'))) { if (StringUtils.isBlank(formData.get('id') as string)) {
const data = await createSong(formData); const data = await createSong(formData);
console.log(data); console.log(data);
} else { } else {
@ -108,7 +108,6 @@ export default function Page() {
return ( return (
<> <>
<div className="container"> <div className="container">
<div className="eight columns">
<div> <div>
<em>{album.title}</em> by {album.artist} ({album.genre}) <em>{album.title}</em> by {album.artist} ({album.genre})
</div> </div>
@ -143,7 +142,6 @@ export default function Page() {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
<Modal <Modal
show={show} show={show}

View File

@ -40,7 +40,7 @@ export default function Page() {
const formData = new FormData(event.currentTarget); const formData = new FormData(event.currentTarget);
try { try {
if (StringUtils.isBlank(formData.get('id'))) { if (StringUtils.isBlank(formData.get('id') as string)) {
const data = await createAlbum(formData); const data = await createAlbum(formData);
console.log(data); console.log(data);
} else { } else {

View File

@ -1,5 +1,5 @@
export class StringUtils { export class StringUtils {
static isBlank(str) { static isBlank(str: string) {
return (!str || /^\s*$/.test(str)); return (!str || /^\s*$/.test(str));
} }
} }