Sprint 7: Gassi-Treffen — Meetup-Feature komplett
- Backend: walks.py mit allen Endpoints (CRUD, join/leave, Haversine-Filter) - DB: walks, walk_participants, walk_participant_dogs Tabellen (bereits in database.py) - Frontend: walks.js — Liste/Karte-Toggle, Heute/Demnächst-Gruppierung, Detail-Modal mit Teilnehmerliste, Beitreten/Verlassen, Erstellen/Bearbeiten-Formulare - CSS: Walks-Komponenten (Card, Date-Badge, Spots-Anzeige, Map-View) - api.js: walks-Abschnitt (list, get, create, update, cancel, join, leave) - SW-Cache: by-v20 → by-v21
This commit is contained in:
parent
b9df636535
commit
ec17dfb029
6 changed files with 977 additions and 2 deletions
|
|
@ -190,6 +190,23 @@ const API = (() => {
|
|||
delete(id) { return del(`/routes/${id}`); },
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// GASSI-TREFFEN
|
||||
// ----------------------------------------------------------
|
||||
const walks = {
|
||||
list(lat = null, lon = null, radius = 20000) {
|
||||
const params = new URLSearchParams({ radius });
|
||||
if (lat !== null) { params.set('lat', lat); params.set('lon', lon); }
|
||||
return get(`/walks?${params}`);
|
||||
},
|
||||
get(id) { return get(`/walks/${id}`); },
|
||||
create(data) { return post('/walks', data); },
|
||||
update(id, data) { return patch(`/walks/${id}`, data); },
|
||||
cancel(id) { return del(`/walks/${id}`); },
|
||||
join(id, dogIds) { return post(`/walks/${id}/join`, { dog_ids: dogIds }); },
|
||||
leave(id) { return del(`/walks/${id}/join`); },
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// WETTER
|
||||
// ----------------------------------------------------------
|
||||
|
|
@ -267,7 +284,7 @@ const API = (() => {
|
|||
return {
|
||||
get, post, put, patch, del, upload,
|
||||
auth, dogs, diary, health, tieraerzte, poison,
|
||||
places, routes, weather, push,
|
||||
places, routes, walks, weather, push,
|
||||
subscribeToPush, getLocation,
|
||||
APIError,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue