feat: implement proxy routes for APIs, add Pinia stores for loket, clinic, and queue management, and create new pages for admin and anjungan dashboard.
This commit is contained in:
No files matched your search
@@ -100,7 +100,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
throw new Error(`Klinik ID tidak ditemukan untuk kode: ${kodeKlinik}`);
|
||||
}
|
||||
|
||||
const url = `/visit-api/visit?klinik_id=${clinic.id}&limit=500`;
|
||||
const url = `${config.public.externalApiBaseUrl}/visit?klinik_id=${clinic.id}&limit=500`;
|
||||
console.log(`🔄 [queueStore] Fetching patients for clinic ${kodeKlinik} (ID: ${clinic.id})...`);
|
||||
|
||||
const response = await fetch(url);
|
||||
@@ -429,7 +429,7 @@ export const useQueueStore = defineStore('queue', () => {
|
||||
const { connect, disconnect, sendViaPost, isConnected } = useWebSocket({
|
||||
url: wsBaseUrl,
|
||||
clientId: wsClientId,
|
||||
fallbackPostUrl: '/stats-api/ws',
|
||||
fallbackPostUrl: `${config.public.externalApiBaseUrl}/ws`,
|
||||
reconnectInterval: 2000, // 2 seconds between reconnect attempts
|
||||
maxReconnectAttempts: 9999, // Effectively infinite — never give up on remote machines
|
||||
onOpen: () => {
|
||||
@@ -2789,7 +2789,7 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
case "terlambat":
|
||||
// Send API call to update status to 33 (TR PEMERIKSAAN)
|
||||
try {
|
||||
const visitApiBase = '/visit-api';
|
||||
const visitApiBase = config.public.externalApiBaseUrl || 'http://10.10.123.135:8084/api/v1';
|
||||
const apiUrl = `${visitApiBase}/visit/status/finish`;
|
||||
const requestBody = {
|
||||
patient_visit_healthcare_service_id: patient.healthcareServiceId,
|
||||
@@ -2814,7 +2814,7 @@ const fetchPatientsForLoket = async (loketId, force = false) => {
|
||||
case "pending":
|
||||
// Send API call to update status to 32 (PE PEMERIKSAAN)
|
||||
try {
|
||||
const visitApiBase = '/visit-api';
|
||||
const visitApiBase = config.public.externalApiBaseUrl || 'http://10.10.123.135:8084/api/v1';
|
||||
const apiUrl = `${visitApiBase}/visit/status/finish`;
|
||||
const requestBody = {
|
||||
patient_visit_healthcare_service_id: patient.healthcareServiceId,
|
||||
|
||||
Reference in New Issue
Block a user