feat: Add patient verification store and configure new ekstrakExpertiseUrl and verificationApiBaseUrl endpoints.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user