Refactor router
This commit is contained in:
committed by
Thomas Citharel
parent
d73f738b1b
commit
53cb39350a
@@ -99,6 +99,7 @@ import { LOGGED_PERSON } from '@/graphql/actor';
|
||||
import { IEvent, IParticipant } from '@/types/event.model';
|
||||
import { JOIN_EVENT } from '@/graphql/event';
|
||||
import { IPerson } from '@/types/actor.model';
|
||||
import { RouteName } from '@/router'
|
||||
|
||||
// No typings for this component, so we use require
|
||||
const VueMarkdown = require('vue-markdown');
|
||||
@@ -140,7 +141,7 @@ export default class Event extends Vue {
|
||||
}
|
||||
});
|
||||
|
||||
router.push({ name: 'EventList' })
|
||||
router.push({ name: RouteName.EVENT })
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
@@ -19,10 +19,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import ngeohash from "ngeohash";
|
||||
import VueMarkdown from "vue-markdown";
|
||||
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
||||
import EventCard from "@/components/Event/EventCard.vue";
|
||||
import ngeohash from 'ngeohash';
|
||||
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
||||
import EventCard from '@/components/Event/EventCard.vue';
|
||||
import { RouteName } from '@/router';
|
||||
|
||||
// VueMarkdown is untyped
|
||||
const VueMarkdown = require('vue-markdown');
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -36,7 +39,7 @@ export default class EventList extends Vue {
|
||||
events = [];
|
||||
loading = true;
|
||||
locationChip = false;
|
||||
locationText = "";
|
||||
locationText = '';
|
||||
|
||||
created() {
|
||||
this.fetchData(this.$router.currentRoute.params["location"]);
|
||||
@@ -50,7 +53,7 @@ export default class EventList extends Vue {
|
||||
@Watch("locationChip")
|
||||
onLocationChipChange(val) {
|
||||
if (val === false) {
|
||||
this.$router.push({ name: "EventList" });
|
||||
this.$router.push({ name: RouteName.EVENT_LIST });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +89,7 @@ export default class EventList extends Vue {
|
||||
}
|
||||
|
||||
viewEvent(event) {
|
||||
this.$router.push({ name: "Event", params: { uuid: event.uuid } });
|
||||
this.$router.push({ name: RouteName.EVENT, params: { uuid: event.uuid } });
|
||||
}
|
||||
|
||||
downloadIcsEvent(event) {
|
||||
|
||||
Reference in New Issue
Block a user