I am using Strapi with Nuxt and I would like to redirect to the new order it was created after successfully posting the order to Strapi. What I'm looking for is the equivalent of mysql_insert_id() in the PHP world.
try {
const neworder = await this.$strapi.$orders.create(this.neworder)
console.log(neworder)
if(neworder !== null) {
this.$router.push({ name:'order-id', params: neworder.id })
}
} catch (error) {
this.error = error
}
I can see the new id on the console log:

How do I access the returned id and pass it to this.$router.push's params? I tried using 'id' same as it shows on the console but no luck.
I figured it out. I'm going to leave this open in case it helps someone else.
redirect ($router.push) should be like this:
this.$router.push({ name:'order-id', params: {id: neworder.id }})