feat: Add patient verification store and configure new ekstrakExpertiseUrl and verificationApiBaseUrl endpoints.

This commit is contained in:
Fanrouver
2026-02-18 08:00:29 +07:00
parent 8c6b3fd5dc
commit f78bbea4b0
3 changed files with 23 additions and 1 deletions
+5
View File
@@ -74,3 +74,8 @@ POST_LOGOUT_REDIRECT_URI="https://antrean.dev.rssa.id/LoginPage"
# API eksternal untuk validasi JWT token # API eksternal untuk validasi JWT token
EXTERNAL_API_BASE_URL="http://10.10.150.100:8084" EXTERNAL_API_BASE_URL="http://10.10.150.100:8084"
EXTERNAL_API_TIMEOUT=10000 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"
+2
View File
@@ -81,6 +81,8 @@ export default defineNuxtConfig({
// authUrl: process.env.AUTH_ORIGIN || "http://10.10.150.175:3001", // authUrl: process.env.AUTH_ORIGIN || "http://10.10.150.175:3001",
// authUrl: process.env.AUTH_ORIGIN || "http://localhost:3001", // authUrl: process.env.AUTH_ORIGIN || "http://localhost:3001",
wsBaseUrl: process.env.WS_BASE_URL || 'ws://10.10.150.100:8084/api/v1/ws', 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',
}, },
}, },
+16 -1
View File
@@ -8,7 +8,18 @@ export const useVerificationStore = defineStore('verification', () => {
const error = ref(null); const error = ref(null);
// API Base URL // 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 // Helpers
const formatAddress = (p) => { const formatAddress = (p) => {
@@ -32,6 +43,8 @@ export const useVerificationStore = defineStore('verification', () => {
const fetchAllPatients = async () => { const fetchAllPatients = async () => {
loading.value = true; loading.value = true;
error.value = null; error.value = null;
const API_BASE_URL = getApiBaseUrl();
console.log('Fetching all patients from:', `${API_BASE_URL}/pasien/search`);
try { try {
const result = await $fetch(`${API_BASE_URL}/pasien/search`, { const result = await $fetch(`${API_BASE_URL}/pasien/search`, {
params: { nama: 'AA' } params: { nama: 'AA' }
@@ -56,6 +69,7 @@ export const useVerificationStore = defineStore('verification', () => {
const fetchPatientByRm = async (rm) => { const fetchPatientByRm = async (rm) => {
loading.value = true; loading.value = true;
error.value = null; error.value = null;
const API_BASE_URL = getApiBaseUrl();
try { try {
const result = await $fetch(`${API_BASE_URL}/pasien/${rm}`); const result = await $fetch(`${API_BASE_URL}/pasien/${rm}`);
@@ -81,6 +95,7 @@ export const useVerificationStore = defineStore('verification', () => {
const searchPatientsByName = async (name) => { const searchPatientsByName = async (name) => {
loading.value = true; loading.value = true;
error.value = null; error.value = null;
const API_BASE_URL = getApiBaseUrl();
try { try {
const result = await $fetch(`${API_BASE_URL}/pasien/search`, { const result = await $fetch(`${API_BASE_URL}/pasien/search`, {
params: { nama: name } params: { nama: name }