1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-04 20:55:19 +02:00

Enhance Adventure model and serializers with visited status logic and toast notifications for marking visits

This commit is contained in:
Sean Morley 2025-05-22 21:13:31 -04:00
parent 84cd136401
commit a1062e72cf
4 changed files with 45 additions and 12 deletions

View file

@ -55,7 +55,7 @@
}
$: if (triggerMarkVisted && willBeMarkedVisited) {
markVisited();
displaySuccessToast(); // since the server will trigger the geocode automatically, we just need to show the toast and let the server handle the rest. It's kinda a placebo effect...
triggerMarkVisted = false;
}
@ -102,6 +102,17 @@
}
}
function displaySuccessToast() {
if (reverseGeocodePlace) {
if (reverseGeocodePlace.region) {
addToast('success', `Visit to ${reverseGeocodePlace.region} marked`);
}
if (reverseGeocodePlace.city) {
addToast('success', `Visit to ${reverseGeocodePlace.city} marked`);
}
}
}
async function markVisited() {
console.log(reverseGeocodePlace);
if (reverseGeocodePlace) {

View file

@ -45,6 +45,9 @@ export type Adventure = {
category: Category | null;
attachments: Attachment[];
user?: User | null;
city?: string | null;
region?: string | null;
country?: string | null;
};
export type AdditionalAdventure = Adventure & {