text: import { updateVersion } from '@apps/maha/services/versions'
  import Website from '@apps/websites/models/website'
  
  const updateRoute = async (req, res) => {
  
    const website = await Website.query(qb => {
      qb.select('websites_websites.*','websites_website_user_access.type as access_type')
      qb.joinRaw('inner join websites_website_user_access on websites_website_user_access.website_id=websites_websites.id and websites_website_user_access.user_id=?', req.user.get('id'))
      qb.where('team_id', req.team.get('id'))
      qb.whereNull('deleted_at')
      qb.where('id', req.params.website_id)
    }).fetch({
      transacting: req.trx
    })
  
    if(!website) return res.status(404).respond({
      code: 404,
      message: 'Unable to load website'
    })
  
    await updateVersion(req, {
      versionable_type: 'websites_websites',
      versionable_id: req.params.website_id,
      key: 'theme',
      value: req.body.value
    })
  
    await res.status(200).respond(true)
  
  }
  
  export default updateRoute
  