diff --git a/app/components/Admin/ModalForm.vue b/app/components/Admin/ModalForm.vue
index adadc00..14b174e 100644
--- a/app/components/Admin/ModalForm.vue
+++ b/app/components/Admin/ModalForm.vue
@@ -1,8 +1,6 @@
@@ -84,12 +126,19 @@ const save = async () => {
:predefined="props.item?.[field.key]"
:multiple="field.type == 'search-select-array'"
/>
+ (localItem[field.key] = v)"
+ />
diff --git a/app/pages/admin/songs.vue b/app/pages/admin/songs.vue
index 1473c54..45d57e2 100644
--- a/app/pages/admin/songs.vue
+++ b/app/pages/admin/songs.vue
@@ -63,6 +63,8 @@ const modalFields: Field[] = [
type: "search-select",
fetchOptions: albumFetchOptions,
},
+ { key: "lyrics.text", label: "Lyrics", type: "textarea", rows: 6 },
+ { key: "lyrics.synced", label: "Synced lyrics", type: "checkbox" },
]
const showModal = ref(false)
@@ -73,7 +75,10 @@ const save = async (value: any) => {
try {
await cfetch("/admin/track", {
method: "PATCH",
- data: value,
+ data: {
+ ...value,
+ lyrics: JSON.stringify(value.lyrics),
+ },
params: { id: value._id },
forceFormData: true,
})
@@ -88,7 +93,10 @@ const save = async (value: any) => {
try {
await cfetch("/admin/track", {
method: "POST",
- data: value,
+ data: {
+ ...value,
+ lyrics: JSON.stringify(value.lyrics),
+ },
})
toast.show("Song added successfully", "success")
@@ -137,8 +145,6 @@ const show = (id?: string) => {
showModal.value = true
}
-
-watch(data, () => console.log(data))
diff --git a/app/ui/Input.vue b/app/ui/Input.vue
index d6884e3..c87dda0 100644
--- a/app/ui/Input.vue
+++ b/app/ui/Input.vue
@@ -11,6 +11,8 @@ interface InputProps {
required?: boolean
autocomplete?: AutocompleteType
label?: string
+ textarea?: boolean
+ rows?: number
}
const value = defineModel("value")
@@ -63,7 +65,7 @@ const onFileChange = (e: Event) => {
emit('input', e.target?.value)"
@@ -76,6 +78,20 @@ const onFileChange = (e: Event) => {
:autocomplete="props.autocomplete"
/>
+