From 7b2f27f5fe933345551147ba75a14b383d75d2c4 Mon Sep 17 00:00:00 2001 From: Igor Escalona Date: Tue, 1 Oct 2024 00:05:33 -0400 Subject: [PATCH] Change default year value type and form --- src/generated/typings/index.ts | 2 +- src/views/ViewTrackDetails.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generated/typings/index.ts b/src/generated/typings/index.ts index 8b1ec6ae..7c0cb0d1 100644 --- a/src/generated/typings/index.ts +++ b/src/generated/typings/index.ts @@ -31,4 +31,4 @@ export type SortOrder = "Asc" | "Dsc"; * Track * represent a single track, id and path should be unique */ -export type Track = { _id: string, title: string, album: string, artists: Array, genres: Array, year: number, duration: number, track: NumberOf, disk: NumberOf, path: string, }; +export type Track = { _id: string, title: string, album: string, artists: Array, genres: Array, year: number | null, duration: number, track: NumberOf, disk: NumberOf, path: string, }; diff --git a/src/views/ViewTrackDetails.tsx b/src/views/ViewTrackDetails.tsx index e97eba40..04387dee 100644 --- a/src/views/ViewTrackDetails.tsx +++ b/src/views/ViewTrackDetails.tsx @@ -141,7 +141,7 @@ export default function ViewTrackDetails() { type="number" min="1900" step="1" - value={formData.year} + value={formData.year ?? 0} onChange={(e) => { setFormData({ ...formData, year: Number(e.currentTarget.value) }); }}