@@ -46,19 +46,19 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue } from "vue-property-decorator";
|
||||
import { IDENTITIES, LOGGED_PERSON, CREATE_PERSON } from "../../graphql/actor";
|
||||
import { IPerson } from "@/types/actor.model";
|
||||
import { Component, Vue } from 'vue-property-decorator';
|
||||
import { IDENTITIES, LOGGED_PERSON, CREATE_PERSON } from '../../graphql/actor';
|
||||
import { IPerson } from '@/types/actor.model';
|
||||
|
||||
@Component({
|
||||
apollo: {
|
||||
identities: {
|
||||
query: IDENTITIES
|
||||
query: IDENTITIES,
|
||||
},
|
||||
loggedPerson: {
|
||||
query: LOGGED_PERSON
|
||||
}
|
||||
}
|
||||
query: LOGGED_PERSON,
|
||||
},
|
||||
},
|
||||
})
|
||||
export default class Identities extends Vue {
|
||||
identities: IPerson[] = [];
|
||||
@@ -73,7 +73,7 @@ export default class Identities extends Vue {
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: CREATE_PERSON,
|
||||
variables: this.newPerson
|
||||
variables: this.newPerson,
|
||||
});
|
||||
this.showCreateProfileForm = false;
|
||||
this.$apollo.queries.identities.refresh();
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { FETCH_PERSON, LOGGED_PERSON } from "@/graphql/actor";
|
||||
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
||||
import EventCard from "@/components/Event/EventCard.vue";
|
||||
import { RouteName } from '@/router'
|
||||
import { FETCH_PERSON, LOGGED_PERSON } from '@/graphql/actor';
|
||||
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
|
||||
import EventCard from '@/components/Event/EventCard.vue';
|
||||
import { RouteName } from '@/router';
|
||||
|
||||
@Component({
|
||||
apollo: {
|
||||
@@ -77,17 +77,17 @@ import { RouteName } from '@/router'
|
||||
query: FETCH_PERSON,
|
||||
variables() {
|
||||
return {
|
||||
name: this.$route.params.name
|
||||
name: this.$route.params.name,
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
loggedPerson: {
|
||||
query: LOGGED_PERSON
|
||||
}
|
||||
query: LOGGED_PERSON,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
EventCard
|
||||
}
|
||||
EventCard,
|
||||
},
|
||||
})
|
||||
export default class Profile extends Vue {
|
||||
@Prop({ type: String, required: true }) name!: string;
|
||||
@@ -95,7 +95,7 @@ export default class Profile extends Vue {
|
||||
person = null;
|
||||
|
||||
// call again the method if the route changes
|
||||
@Watch("$route")
|
||||
@Watch('$route')
|
||||
onRouteChange() {
|
||||
// this.fetchData()
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export default class Profile extends Vue {
|
||||
}
|
||||
|
||||
nl2br(text) {
|
||||
return text.replace(/(?:\r\n|\r|\n)/g, "<br>");
|
||||
return text.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -70,11 +70,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
import { IPerson } from "@/types/actor.model";
|
||||
import { REGISTER_PERSON } from "@/graphql/actor";
|
||||
import { MOBILIZON_INSTANCE_HOST } from "@/api/_entrypoint";
|
||||
import { RouteName } from '@/router'
|
||||
import { Component, Prop, Vue } from 'vue-property-decorator';
|
||||
import { IPerson } from '@/types/actor.model';
|
||||
import { REGISTER_PERSON } from '@/graphql/actor';
|
||||
import { MOBILIZON_INSTANCE_HOST } from '@/api/_entrypoint';
|
||||
import { RouteName } from '@/router';
|
||||
|
||||
@Component
|
||||
export default class Register extends Vue {
|
||||
@@ -104,7 +104,7 @@ export default class Register extends Vue {
|
||||
this.errors = {};
|
||||
await this.$apollo.mutate({
|
||||
mutation: REGISTER_PERSON,
|
||||
variables: Object.assign({ email: this.email }, this.person)
|
||||
variables: Object.assign({ email: this.email }, this.person),
|
||||
});
|
||||
this.validationSent = true;
|
||||
|
||||
@@ -115,7 +115,7 @@ export default class Register extends Vue {
|
||||
this.errors = error.graphQLErrors.reduce((acc, error) => {
|
||||
acc[error.details] = error.message;
|
||||
return acc;
|
||||
}, {});
|
||||
}, {});
|
||||
console.error(error);
|
||||
console.error(this.errors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user