trailpack-proxy-cart
Version:
eCommerce - Trailpack for Proxy Engine
94 lines (93 loc) • 2.08 kB
JavaScript
module.exports = {
default: (app) => {
return {
include: [
{
model: app.orm['Collection'],
as: 'collections',
attributes: {
exclude: ['created_at','updated_at']
},
include: [
{
model: app.orm['Image'],
as: 'images',
attributes: {
exclude: ['src','created_at','updated_at']
}
}
]
},
{
model: app.orm['Image'],
as: 'images',
attributes: {
exclude: ['src','created_at','updated_at']
}
},
{
model: app.orm['Tag'],
as: 'tags',
attributes: ['name', 'id'],
order: [['name', 'ASC']]
}
]
// order: [
// [
// {
// model: app.orm['Image'],
// through: 'ItemImage',
// as: 'images'
// },
// 'position'
// ]
// ]
}
},
findAndCountDefault: (app) => {
return {
distinct: true,
include: [
{
model: app.orm['Collection'],
as: 'collections',
attributes: {
exclude: ['created_at','updated_at']
},
include: [
{
model: app.orm['Image'],
as: 'images',
attributes: {
exclude: ['src','created_at','updated_at']
}
}
]
},
{
model: app.orm['Image'],
as: 'images',
attributes: {
exclude: ['src','created_at','updated_at']
}
},
{
model: app.orm['Tag'],
as: 'tags',
attributes: ['name', 'id'],
order: [['name', 'ASC']]
}
]
// order: [
// [
// {
// model: app.orm['Image'],
// through: 'ItemImage',
// as: 'images'
// },
// 'position'
// ]
// ]
}
}
}