Update nuisance submission to go to submitted page

This commit is contained in:
Eli Ribble 2026-04-08 17:49:32 +00:00
parent c41154a200
commit 2c0bfb9904
No known key found for this signature in database
31 changed files with 747 additions and 228 deletions

View file

@ -535,8 +535,15 @@ import ImageUpload, { Image } from "@/components/ImageUpload.vue";
import MapLocator from "@/components/MapLocator.vue";
import { useGeocodeStore } from "@/store/geocode";
import { useLocationStore } from "@/store/location";
import { useStorePublicreport } from "@/store/publicreport";
import type { Marker } from "@/types";
import type { Address, Geocode, GeocodeSuggestion, Location } from "@/type/api";
import type {
Address,
Geocode,
GeocodeSuggestion,
Location,
Publicreport,
} from "@/type/api";
import type { Camera } from "@/type/map";
const address = ref<string>("");
@ -551,6 +558,7 @@ const marker = ref<Marker | null>(null);
const showMore = ref<boolean>(false);
const selectedSuggestion = ref<GeocodeSuggestion | null>(null);
const locationStore = useLocationStore();
const storePublicreport = useStorePublicreport();
const geocode = useGeocodeStore();
const markers = computed((): Marker[] => {
if (marker.value) {
@ -641,8 +649,9 @@ async function doSubmit() {
body: formData,
// Don't set Content-Type, the borwser should do it
});
const data = await resp.json();
router.push("/complete/" + data.id);
const data: Publicreport = (await resp.json()) as Publicreport;
storePublicreport.add(data);
router.push("/submitted/" + data.id);
} catch (error) {
errorMessage.value =
error instanceof Error ? error.message : "Upload failed";