Skip to content

Beautiful Open-Source Form Builder

migrate-to-nuxt-useappconfig (#263)

Chirag Chhatrala56e533581cf8
diff --git a/client/app.config.ts b/client/app.config.ts
new file mode 100644
index 000000000..a8592564b
--- /dev/null
+++ b/client/app.config.ts
@@ -0,0 +1,7 @@
+// https://nuxt.com/docs/guide/directory-structure/app-config
+
+import opnformConfig from "~/opnform.config.js";
+
+export default defineAppConfig({
+ ...opnformConfig
+})
\ No newline at end of file
diff --git a/client/components/global/Navbar.vue b/client/components/global/Navbar.vue
index 6853527e7..d7fa9a4ec 100644
--- a/client/components/global/Navbar.vue
+++ b/client/components/global/Navbar.vue
@@ -152,7 +152,7 @@ export default {
appStore: useAppStore(),
formsStore: useFormsStore(),
workspacesStore: useWorkspacesStore(),
- config: useConfig(),
+ config: useAppConfig(),
user: computed(() => authStore.user),
isIframe: useIsIframe(),
}
diff --git a/client/components/global/NotionPage.vue b/client/components/global/NotionPage.vue
index e88eb5ab2..74b768c7a 100644
--- a/client/components/global/NotionPage.vue
+++ b/client/components/global/NotionPage.vue
@@ -16,11 +16,11 @@ export default {
},
async setup(props) {
- const apiUrl = useConfig().notion.worker
+ const apiUrl = useAppConfig().notion.worker
const {data} = await useFetch(`${apiUrl}/page/${props.pageId}`)
return {
- apiUrl: useConfig().notion.worker,
+ apiUrl: useAppConfig().notion.worker,
blockMap: data,
}
}
diff --git a/client/components/open/forms/components/form-components/FormNotifications.vue b/client/components/open/forms/components/form-components/FormNotifications.vue
index c38d73593..a57e78528 100644
--- a/client/components/open/forms/components/form-components/FormNotifications.vue
+++ b/client/components/open/forms/components/form-components/FormNotifications.vue
@@ -56,7 +56,7 @@ export default {
},
computed: {
- zapierUrl: () => useConfig().links.zapier_integration
+ zapierUrl: () => useAppConfig().links.zapier_integration
},
watch: {
diff --git a/client/components/pages/forms/create/CreateFormBaseModal.vue b/client/components/pages/forms/create/CreateFormBaseModal.vue
index c6ddc91aa..cfa33b8a3 100644
--- a/client/components/pages/forms/create/CreateFormBaseModal.vue
+++ b/client/components/pages/forms/create/CreateFormBaseModal.vue
@@ -108,7 +108,7 @@ export default {
computed: {
aiFeaturesEnabled () {
- return useConfig().ai_features_enabled
+ return useAppConfig().ai_features_enabled
}
},
diff --git a/client/composables/useConfig.js b/client/composables/useConfig.js
deleted file mode 100644
index 751243fd3..000000000
--- a/client/composables/useConfig.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import opnformConfig from "~/opnform.config.js";
-export const useConfig = () => opnformConfig
diff --git a/client/pages/index.vue b/client/pages/index.vue
index bd25de410..85b69d052 100644
--- a/client/pages/index.vue
+++ b/client/pages/index.vue
@@ -203,7 +203,7 @@ export default {
const authStore = useAuthStore()
return {
authenticated: computed(() => authStore.check),
- config: useConfig()
+ config: useAppConfig()
}
},