Code-Pop / from-vuex-to-pinia

28 stars 44 forks source link

EventDetails.vue parsing id as number -- EventCreate.vue uses uuidv4 to generate a string as id #6

Open steffennilsen opened 2 years ago

steffennilsen commented 2 years ago

Title should be self explanatory: EventDetails.vue

this.$store.dispatch('fetchEvent', Number(this.id)).catch(error => {

Id is parsed as a number, this works for the initial 3 entries in db.json , but any further events created in EventCreate.vue uses uuidv4

const event = {
  ...this.event,
  id: uuidv4(),
  organizer: this.$store.state.user
}

which is a string, gets parsed to NaN and trips the in-component route guard of EventDetails.vue leading to the 404 page

steffennilsen commented 2 years ago

I see that its been fixed by https://github.com/Code-Pop/from-vuex-to-pinia/pull/5 in the main branch, but it still affects the previous branches, especially branch 03-Begin which is the first one encounter while taking the course

bencodezen commented 2 years ago

Thanks for letting me know! I'll get that fixed asap!