- Add register screen with onboarding redirect to address validation - Add waste separation guide screen with 4 categories and offline tips (organicos, reciclables, sanitarios, especiales) plus preventive messaging banner - Add feedback submission screen with 4 types and 1-5 star rating - Add address screen: list colonias, pick one, validate against backend - Switch from pull-to-refresh GPS hack to periodic polling of /tracking/status (30s) — backend now drives the simulation - Filter notifications by logged-in user.id (tunnel-view on client side) - Add register/logout/address actions to profile screen - Hide login/register/feedback/addresses from tab bar (href: null) - Set API_URL to LAN IP for physical phone testing over hotspot
26 lines
586 B
TypeScript
26 lines
586 B
TypeScript
import { apiFetch } from "../lib/api";
|
|
|
|
export interface Colonia {
|
|
colonia: string;
|
|
routeId: string;
|
|
horarioEstimado: string;
|
|
}
|
|
|
|
export interface MyAddress {
|
|
colonia: string;
|
|
routeId: string;
|
|
horarioEstimado: string | null;
|
|
}
|
|
|
|
export const listColonias = () =>
|
|
apiFetch<Colonia[]>("/api/addresses/colonias");
|
|
|
|
export const getMyAddress = () =>
|
|
apiFetch<MyAddress>("/api/addresses/me");
|
|
|
|
export const setMyAddress = (colonia: string, street?: string) =>
|
|
apiFetch<MyAddress>("/api/addresses/me", {
|
|
method: "PUT",
|
|
body: JSON.stringify({ colonia, street }),
|
|
});
|