vuetify-admin icon indicating copy to clipboard operation
vuetify-admin copied to clipboard

how to use '_id' instead 'id' field in datatable actions

Open drascom opened this issue 4 years ago • 1 comments

hi, first of all thank you for this great template. i add custom data provider and it is working well. But my records id label is '_id' and default edit/delete action buttons not working with that label (when i clicked show or edit buttton it is routing to the dashboard) how can i tell your system to use '_id' instead 'id' ?

drascom avatar Nov 22 '20 15:11 drascom

if you using is mongoose, to model write this

Schema.set('toJSON', {
	virtuals: true,
	versionKey:false,
	transform: function (doc, ret) {   delete ret._id  }
})

kura1420 avatar Dec 13 '21 11:12 kura1420