From f78bbea4b0c1e306ee3e0fd7921702127024a984 Mon Sep 17 00:00:00 2001 From: Fanrouver Date: Wed, 18 Feb 2026 08:00:29 +0700 Subject: [PATCH] feat: Add patient verification store and configure new `ekstrakExpertiseUrl` and `verificationApiBaseUrl` endpoints. --- .env example | 5 +++++ nuxt.config.ts | 2 ++ stores/verificationStore.js | 17 ++++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.env example b/.env example index 502b1ec..e3291ad 100644 --- a/.env example +++ b/.env example @@ -74,3 +74,8 @@ POST_LOGOUT_REDIRECT_URI="https://antrean.dev.rssa.id/LoginPage" # API eksternal untuk validasi JWT token EXTERNAL_API_BASE_URL="http://10.10.150.100:8084" EXTERNAL_API_TIMEOUT=10000 + +# API untuk ekstrak expertise dan verifikasi akun +# Digunakan di pages/verifikasiAkun/VerifikasiAkun.vue +EKSTRAK_EXPERTISE_URL="http://10.10.123.218/ekstrakexpertise" +VERIFICATION_API_BASE_URL="http://10.10.123.140:8089/api/v1" diff --git a/nuxt.config.ts b/nuxt.config.ts index 3e6be5e..86d99d8 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -81,6 +81,8 @@ export default defineNuxtConfig({ // authUrl: process.env.AUTH_ORIGIN || "http://10.10.150.175:3001", // authUrl: process.env.AUTH_ORIGIN || "http://localhost:3001", wsBaseUrl: process.env.WS_BASE_URL || 'ws://10.10.150.100:8084/api/v1/ws', + ekstrakExpertiseUrl: process.env.EKSTRAK_EXPERTISE_URL || 'http://10.10.123.218/ekstrakexpertise', + verificationApiBaseUrl: process.env.VERIFICATION_API_BASE_URL || 'http://10.10.150.131:8089/api/v1', }, }, diff --git a/stores/verificationStore.js b/stores/verificationStore.js index b2f18bb..559dc7f 100644 --- a/stores/verificationStore.js +++ b/stores/verificationStore.js @@ -8,7 +8,18 @@ export const useVerificationStore = defineStore('verification', () => { const error = ref(null); // API Base URL - const API_BASE_URL = 'http://10.10.150.131:8089/api/v1'; + // API Configuration + const config = useRuntimeConfig(); + + // Helper to get API Base URL safely + const getApiBaseUrl = () => { + const url = config.public.verificationApiBaseUrl; + if (!url) { + console.warn('verificationApiBaseUrl is undefined in runtimeConfig, using fallback'); + return 'http://10.10.150.131:8089/api/v1'; + } + return url; + }; // Helpers const formatAddress = (p) => { @@ -32,6 +43,8 @@ export const useVerificationStore = defineStore('verification', () => { const fetchAllPatients = async () => { loading.value = true; error.value = null; + const API_BASE_URL = getApiBaseUrl(); + console.log('Fetching all patients from:', `${API_BASE_URL}/pasien/search`); try { const result = await $fetch(`${API_BASE_URL}/pasien/search`, { params: { nama: 'AA' } @@ -56,6 +69,7 @@ export const useVerificationStore = defineStore('verification', () => { const fetchPatientByRm = async (rm) => { loading.value = true; error.value = null; + const API_BASE_URL = getApiBaseUrl(); try { const result = await $fetch(`${API_BASE_URL}/pasien/${rm}`); @@ -81,6 +95,7 @@ export const useVerificationStore = defineStore('verification', () => { const searchPatientsByName = async (name) => { loading.value = true; error.value = null; + const API_BASE_URL = getApiBaseUrl(); try { const result = await $fetch(`${API_BASE_URL}/pasien/search`, { params: { nama: name }