export default defineNuxtPlugin(async (nuxtApp) => { const { $getapi, $readyapi } = nuxtApp; const connlist = $readyapi([ "common", "tablesetting", "datatype", "settingtype", "settingclass", "colorchoice", "menuchoice", "colorscheme", "Invoice_Status", "Payment_Status", "Delivery_Status", ]); const notReadyConns = connlist.filter((v) => !v.ready); async function getReady() { try { await $getapi(notReadyConns); } catch (error) { showError({ statusCode: 500, statusMessage: `api-loader plugin failed: ${error.message}`, }); } } if (notReadyConns.length > 0) await getReady(); });