Skip to content

Commit

Permalink
Apply event store to further components to fix TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Jul 2, 2024
1 parent b7fbedc commit 94a6ded
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 4 additions & 2 deletions frontend/components/card/about/CardAboutEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ import CardAbout from "./CardAbout.vue";
const idParam = useRoute().params.id;
const id = typeof idParam === "string" ? idParam : undefined;
const event = useEventStore();
await event.fetchByID(id);
const eventStore = useEventStore();
await eventStore.fetchByID(id);
const { event } = eventStore;
const description = ref();
const descriptionExpandable = ref(false);
Expand Down
7 changes: 5 additions & 2 deletions frontend/components/header/HeaderAppPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

<script setup lang="ts">
import type { Organization } from "~/types/entities/organization";
import type { Event } from "~/types/events/event";
import { IconMap } from "~/types/icon-map";
const props = defineProps<{
Expand All @@ -90,15 +91,17 @@ const id = typeof idParam === "string" ? idParam : undefined;
const organizationStore = useOrganizationStore();
let organization: Organization;
const group = useGroupStore();
const event = useEventStore();
const eventStore = useEventStore();
let event: Event;
if (props.pageType === "organization") {
await organizationStore.fetchByID(id);
organization = organizationStore.organization;
} else if (props.pageType === "group") {
await group.fetchByID(id);
} else if (props.pageType === "event") {
await event.fetchByID(id);
await eventStore.fetchByID(id);
event = eventStore.event;
}
const headerName = computed<string>(() => {
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/modal/edit/about/ModalEditAboutEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ const props = defineProps<{
const idParam = useRoute().params.id;
const id = typeof idParam === "string" ? idParam : undefined;
const event = useEventStore();
await event.fetchByID(id);
const eventStore = useEventStore();
await eventStore.fetchByID(id);
const { event } = eventStore;
const formData = ref({
description: event.description,
Expand Down
2 changes: 0 additions & 2 deletions frontend/utils/testEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export const testClimateEvent: Event = {
// supportingUsers: [user, user],
// iconURL: "/images/an_image.svg",
socialLinks: ["climate_org@mastodon", "[email protected]"],
loading: false,
};

export const testTechEvent: Event = {
Expand All @@ -163,7 +162,6 @@ export const testTechEvent: Event = {
startTime: new Date().toLocaleDateString(),
// supportingUsers: [user, user, user],
socialLinks: [""],
loading: false,
};

export const testResource: Resource = {
Expand Down

0 comments on commit 94a6ded

Please sign in to comment.