This is my table field (open) but in response, it returns 0 1 but I want true false instead of 0 1
I am using adonis MySQL
table.boolean('open').notNullable().defaultTo(true).comment('true = open, false = close')
const Model = use('Model')
class Markup extends Model {
static boot() {
super.boot()
this.addTrait('@provider:Lucid/SoftDeletes')
}
static getColumns() {
return ['assignee_id', 'editor_details', 'visibility', 'image_url', 'priority', 'open']
}
comments() {
return this.hasMany('App/Models/Comment', 'id', 'markup_id')
}
assignee() {
return this.belongsTo("App/Models/User", "assignee_id", "id")
}
created_by() {
return this.belongsTo("App/Models/User", 'created_by_id', 'id')
}
resolved_by() {
return this.belongsTo("App/Models/User", 'resolved_by_id', 'id')
}
}
module.exports = Markup
This just a simple fix. you just have to do this in your column.