Replace hardcoded user with live profile data
This commit is contained in:
@@ -2,8 +2,10 @@ import { apiConfig, getAuthenticatedHeaders } from '../config/api.js'
|
||||
import { appointmentMapper } from '../mappers/appointmentMapper.js'
|
||||
|
||||
export const appointmentRepository = {
|
||||
async getAll() {
|
||||
const response = await fetch(`${apiConfig.restUrl}/appointments?select=*,patients(full_name),doctors(full_name)`, {
|
||||
async getAll({ doctorId } = {}) {
|
||||
const doctorFilter = doctorId ? `&doctor_id=eq.${encodeURIComponent(doctorId)}` : ''
|
||||
|
||||
const response = await fetch(`${apiConfig.restUrl}/appointments?select=*,patients(full_name),doctors(full_name)${doctorFilter}`, {
|
||||
headers: getAuthenticatedHeaders()
|
||||
})
|
||||
|
||||
@@ -25,33 +27,5 @@ export const appointmentRepository = {
|
||||
const data = await response.json()
|
||||
const item = Array.isArray(data) ? data[0] : data
|
||||
return appointmentMapper.toUi(item)
|
||||
},
|
||||
|
||||
getTodayTimeline() {
|
||||
return [
|
||||
{ hour: '08:00', patient: 'Carla Mendes', type: 'Consulta inicial', status: 'Confirmada', patientId: 'carla-mendes' },
|
||||
{ hour: '09:30', patient: 'Ana Souza', type: 'Retorno clinico', status: 'Em triagem', patientId: 'ana-souza' },
|
||||
{ hour: '11:00', patient: 'Diego Alves', type: 'Acompanhamento', status: 'Aguardando', patientId: 'diego-alves' },
|
||||
{ hour: '14:30', patient: 'Bruno Lima', type: 'Teleconsulta', status: 'Confirmada', patientId: 'bruno-lima' },
|
||||
{ hour: '16:00', patient: 'Horario protegido', type: 'Revisao de laudos', status: 'Bloqueado', patientId: null },
|
||||
]
|
||||
},
|
||||
|
||||
getPredictiveQueueSummary() {
|
||||
return [
|
||||
{ label: 'Alta prioridade', value: 3, tone: 'red' },
|
||||
{ label: 'A confirmar', value: 5, tone: 'amber' },
|
||||
{ label: 'Teleconsultas', value: 6, tone: 'blue' },
|
||||
]
|
||||
},
|
||||
|
||||
getWeekDays() {
|
||||
return [
|
||||
{ label: 'Seg', day: '06', active: false, count: 6 },
|
||||
{ label: 'Ter', day: '07', active: true, count: 18 },
|
||||
{ label: 'Qua', day: '08', active: false, count: 12 },
|
||||
{ label: 'Qui', day: '09', active: false, count: 9 },
|
||||
{ label: 'Sex', day: '10', active: false, count: 15 },
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user