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
|
|
@ -12,6 +12,7 @@ export const useStoreDistrict = defineStore("district", () => {
|
|||
// Actions
|
||||
async function byURI(uri: string): Promise<District | undefined> {
|
||||
let district = _byURI.value.get(uri);
|
||||
console.log("district by uri", uri, district);
|
||||
if (district) {
|
||||
return district;
|
||||
}
|
||||
|
|
@ -45,6 +46,7 @@ export const useStoreDistrict = defineStore("district", () => {
|
|||
const data: District[] = await response.json();
|
||||
data.forEach((d: District) => {
|
||||
_byURI.value.set(d.uri, d);
|
||||
console.log("district", d.uri);
|
||||
});
|
||||
return data;
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue