Fixed some types and wrong types
This commit is contained in:
1 parent
470cf122a3
commit
581c522b00
5 files changed
+10
-10
No files matched your search
@@ -29,7 +29,7 @@ const computeIfScroll = () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
computeIfScroll()
|
computeIfScroll()
|
||||||
|
|
||||||
window.addEventListener("reisze", computeIfScroll)
|
window.addEventListener("resize", computeIfScroll)
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
window.removeEventListener("resize", computeIfScroll)
|
window.removeEventListener("resize", computeIfScroll)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const tableRows: Row[] = [
|
|||||||
|
|
||||||
import { type Option } from "~/ui/SearchSelect.vue"
|
import { type Option } from "~/ui/SearchSelect.vue"
|
||||||
|
|
||||||
const { data: artistData } = useApiFetch<Genre[]>("/all/artists")
|
const { data: artistData } = useApiFetch<Artist[]>("/all/artists")
|
||||||
const artistFetchOptions = async (q?: string): Promise<Option[]> => {
|
const artistFetchOptions = async (q?: string): Promise<Option[]> => {
|
||||||
return artistData.value.map<Option>((g) => ({
|
return artistData.value.map<Option>((g) => ({
|
||||||
label: g.name,
|
label: g.name,
|
||||||
@@ -65,7 +65,7 @@ const modalFields: Field[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const showModal = ref<boolean>(false)
|
const showModal = ref<boolean>(false)
|
||||||
const item = ref<Track | undefined>(undefined)
|
const item = ref<Album | undefined>(undefined)
|
||||||
|
|
||||||
const save = async (value: any) => {
|
const save = async (value: any) => {
|
||||||
if (value._id) {
|
if (value._id) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { Field } from "~/components/Admin/ModalForm.vue"
|
import type { Field } from "~/components/Admin/ModalForm.vue"
|
||||||
import type { Row } from "~/ui/Table.vue"
|
import type { Row } from "~/ui/Table.vue"
|
||||||
|
|
||||||
const { data, refresh } = useApiFetch<Track[]>("/all/artists")
|
const { data, refresh } = useApiFetch<Artist[]>("/all/artists")
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const tableRows: Row[] = [
|
const tableRows: Row[] = [
|
||||||
@@ -31,7 +31,7 @@ const modalFields: Field[] = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
const showModal = ref<boolean>(false)
|
const showModal = ref<boolean>(false)
|
||||||
const item = ref<Track | undefined>(undefined)
|
const item = ref<Artist | undefined>(undefined)
|
||||||
|
|
||||||
const save = async (value: any) => {
|
const save = async (value: any) => {
|
||||||
if (value._id) {
|
if (value._id) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { Field } from "~/components/Admin/ModalForm.vue"
|
import type { Field } from "~/components/Admin/ModalForm.vue"
|
||||||
import type { Row } from "~/ui/Table.vue"
|
import type { Row } from "~/ui/Table.vue"
|
||||||
|
|
||||||
const { data, refresh } = useApiFetch<Track[]>("/all/genres")
|
const { data, refresh } = useApiFetch<Genre[]>("/all/genres")
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const tableRows: Row[] = [
|
const tableRows: Row[] = [
|
||||||
@@ -22,7 +22,7 @@ const tableRows: Row[] = [
|
|||||||
const modalFields: Field[] = [{ key: "name", label: "Name" }]
|
const modalFields: Field[] = [{ key: "name", label: "Name" }]
|
||||||
|
|
||||||
const showModal = ref<boolean>(false)
|
const showModal = ref<boolean>(false)
|
||||||
const item = ref<Track | undefined>(undefined)
|
const item = ref<Genre | undefined>(undefined)
|
||||||
|
|
||||||
const save = async (value: any) => {
|
const save = async (value: any) => {
|
||||||
if (value._id) {
|
if (value._id) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { Field } from "~/components/Admin/ModalForm.vue"
|
import type { Field } from "~/components/Admin/ModalForm.vue"
|
||||||
import type { Row } from "~/ui/Table.vue"
|
import type { Row } from "~/ui/Table.vue"
|
||||||
|
|
||||||
const { data, refresh } = useApiFetch<Album[]>("/all/tracks")
|
const { data, refresh } = useApiFetch<Track[]>("/all/tracks")
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
|
||||||
const tableRows: Row[] = [
|
const tableRows: Row[] = [
|
||||||
@@ -32,7 +32,7 @@ const tableRows: Row[] = [
|
|||||||
|
|
||||||
import { type Option } from "~/ui/SearchSelect.vue"
|
import { type Option } from "~/ui/SearchSelect.vue"
|
||||||
|
|
||||||
const { data: artistData } = useApiFetch<Genre[]>("/all/artists")
|
const { data: artistData } = useApiFetch<Artist[]>("/all/artists")
|
||||||
const artistFetchOptions = async (q?: string): Promise<Option[]> => {
|
const artistFetchOptions = async (q?: string): Promise<Option[]> => {
|
||||||
return artistData.value.map<Option>((g) => ({
|
return artistData.value.map<Option>((g) => ({
|
||||||
label: g.name,
|
label: g.name,
|
||||||
@@ -40,7 +40,7 @@ const artistFetchOptions = async (q?: string): Promise<Option[]> => {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data: albumData } = useApiFetch<Genre[]>("/all/albums")
|
const { data: albumData } = useApiFetch<Album[]>("/all/albums")
|
||||||
const albumFetchOptions = async (q?: string): Promise<Option[]> => {
|
const albumFetchOptions = async (q?: string): Promise<Option[]> => {
|
||||||
return albumData.value.map<Option>((g) => ({
|
return albumData.value.map<Option>((g) => ({
|
||||||
label: g.name,
|
label: g.name,
|
||||||
|
|||||||
Reference in new issue
Block a user