setColumnForQuery.js 288 B

12345678910
  1. 'use strict';
  2. const _ = require('lodash');
  3. module.exports = options => {
  4. return async function setcolumnforquery(ctx, next) {
  5. const query = ctx.request.query;
  6. const customer = _.get(ctx.user, '_id');
  7. if (!query.customer) query.customer = customer;
  8. await next();
  9. };
  10. };