Как я мог перенаправить пользователя на пост, который он создал?Я использую mongo, express и vue. Мой запрос POST
выглядит следующим образом:
async addOrder () {
if(this.name.length > 0 && this.address.length > 4 && this.city.length > 3) {
await PostsService.addOrder(
this.postData = {
order: this.cart,
name: this.name,
address: this.address,
city: this.city,
zip: this.zip,
country: this.countries,
summary: this.summary,
status: this.status,
})
this.$router.push({ name: 'EachOrder', params: { id: order.id} )
} else {
alert('Fill the form')
}
},
Я знал, что мне нужно как-то создать ID
, но у меня нет доступа до этогоотправить запрос.Любая идея: D?
(извините за мой английский ^^)