Ongoing adaptation to new backend structure
This commit is contained in:
@@ -49,30 +49,28 @@ const SolicitudesContent = ({ reqConfig }) => {
|
||||
searchFn: (entry, term) => {
|
||||
const normalized = term.toLowerCase();
|
||||
return (
|
||||
entry.pre_display_name?.toLowerCase().includes(normalized) ||
|
||||
entry.pre_dni?.toLowerCase().includes(normalized) ||
|
||||
entry.pre_email?.toLowerCase().includes(normalized) ||
|
||||
String(entry.pre_phone).includes(normalized)
|
||||
entry.preDisplayName?.toLowerCase().includes(normalized) ||
|
||||
entry.preDni?.toLowerCase().includes(normalized) ||
|
||||
entry.preEmail?.toLowerCase().includes(normalized) ||
|
||||
String(entry.prePhone).includes(normalized)
|
||||
);
|
||||
},
|
||||
sortFn: (a, b) => a.request_status - b.request_status
|
||||
sortFn: (a, b) => a.status - b.status
|
||||
});
|
||||
|
||||
const handleAccept = async (entry) => {
|
||||
const url = reqConfig.acceptUrl.replace(":request_id", entry.request_id);
|
||||
const url = reqConfig.acceptUrl.replace(":requestId", entry.requestId);
|
||||
try {
|
||||
await putData(url, {});
|
||||
console.log("✅ Solicitud aceptada:", entry.request_id);
|
||||
} catch (err) {
|
||||
console.error("❌ Error al aceptar solicitud:", err.message);
|
||||
}
|
||||
};
|
||||
|
||||
const handleReject = async (entry) => {
|
||||
const url = reqConfig.rejectUrl.replace(":request_id", entry.request_id);
|
||||
const url = reqConfig.rejectUrl.replace(":requestId", entry.requestId);
|
||||
try {
|
||||
await putData(url, {});
|
||||
console.log("🛑 Solicitud rechazada:", entry.request_id);
|
||||
} catch (err) {
|
||||
console.error("❌ Error al rechazar solicitud:", err.message);
|
||||
}
|
||||
@@ -107,7 +105,7 @@ const SolicitudesContent = ({ reqConfig }) => {
|
||||
items={filtered}
|
||||
renderCard={(entry) => (
|
||||
<SolicitudCard
|
||||
key={entry.request_id}
|
||||
key={entry.requestId}
|
||||
data={entry}
|
||||
onAccept={() => handleAccept(entry)}
|
||||
onReject={() => handleReject(entry)}
|
||||
|
||||
Reference in New Issue
Block a user