Migrate existing ts types from the API into the API module
This makes it possible to start hydrating the types into valid data types like Dates which means I can get type safety guarantees when displaying information.
This commit is contained in:
parent
b2c24a0438
commit
f88ca57d97
39 changed files with 382 additions and 320 deletions
|
|
@ -258,8 +258,8 @@ import { ref, onMounted } from "vue";
|
|||
import { computedAsync } from "@vueuse/core";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useStoreDistrict } from "@/rmo/store/district";
|
||||
import { useStorePublicreport } from "@/store/publicreport";
|
||||
import type { District, Publicreport } from "@/type/api";
|
||||
import { useStorePublicReport } from "@/store/publicreport";
|
||||
import type { District, PublicReport } from "@/type/api";
|
||||
|
||||
interface FormData {
|
||||
name: string;
|
||||
|
|
@ -286,10 +286,10 @@ const formData = ref<FormData>({
|
|||
});
|
||||
const router = useRouter();
|
||||
const storeDistrict = useStoreDistrict();
|
||||
const storePublicreport = useStorePublicreport();
|
||||
const storePublicReport = useStorePublicReport();
|
||||
|
||||
const report = computedAsync(async (): Promise<Publicreport | undefined> => {
|
||||
return await storePublicreport.byID(props.id);
|
||||
const report = computedAsync(async (): Promise<PublicReport | undefined> => {
|
||||
return await storePublicReport.byID(props.id);
|
||||
});
|
||||
const district = computedAsync(async (): Promise<District | undefined> => {
|
||||
if (!(report.value && report.value.district)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue