import { defineStore } from 'pinia'
import { useDataStore } from '@/stores/dataStore'
import { useSiteManagementMenuStore } from '../stores/siteManagementMenuStore'
import { useRoute } from 'vue-router'

export const useSiteManagementMenuService = defineStore('siteManagementMenuService', () => {
  const dataStore = useDataStore()
  const siteManagementMenuStore = useSiteManagementMenuStore()
  const route = useRoute()

  const GetMenuContentList = async () => {
    let data: Record<string, any> | any = await dataStore.dataGet(
      'Menu/Konum/' + route.params.menuId
    )

    if (data !== 'errorfalse') {
        siteManagementMenuStore.menuContentList = data
    }
  }

  return {  GetMenuContentList }
})
