feat: directorio más fiable y más fácil de usar
El objetivo de estos cambios es, por un lado, mantener los datos
actualizados y, por otro, mejorar la experiencia para quienes lo usan:
- Fiabilidad: los locales se pueden confirmar ("Sigue aquí") y
reportar (cerrado, datos incorrectos...), y se avisa de duplicados
antes de publicar, para que el contenido no se quede obsoleto ni
repetido.
- Usabilidad: autocompletado al proponer, favoritos, "cerca de mí",
compartir fichas, enlaces a Waze y una política de privacidad
visible, para que sea más sencillo aportar y encontrar locales.
This commit is contained in:
+33
@@ -54,6 +54,15 @@ export async function enviarPropuesta(local) {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function comprobarDuplicado({ nombre, provincia, lat, lng }) {
|
||||
const response = await fetch(`${API_URL}/check-duplicado`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ nombre, provincia, lat, lng }),
|
||||
});
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function aprobarPropuesta(p) {
|
||||
const response = await fetch(`${API_URL}/aprobar/${p.id}`, {
|
||||
method: "POST",
|
||||
@@ -77,6 +86,30 @@ export async function deleteLocal(id) {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function confirmarLocal(id) {
|
||||
const response = await fetch(`${API_URL}/locales/${id}/confirmar`, { method: "POST" });
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function reportarLocal(id, motivo, comentario) {
|
||||
const response = await fetch(`${API_URL}/locales/${id}/reportar`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ motivo, comentario }),
|
||||
});
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function obtenerReportes() {
|
||||
const response = await fetch(`${API_URL}/reportes`);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function descartarReporte(id) {
|
||||
const response = await fetch(`${API_URL}/reportes/${id}/descartar`, { method: "POST" });
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function obtenerPalabrasFiltradas() {
|
||||
try {
|
||||
const response = await fetch(`${API_URL}/config/filtro_palabras`);
|
||||
|
||||
Reference in New Issue
Block a user