UNPKG

flexbiz-server

Version:

Flexible Server

2 lines (1 loc) 510 B
'use strict';const participant=global.getModel("participant"),controller=require("../../controllers/controllerRPT");module.exports=function($router$$){new controller($router$$,"referredusers",function($req$$,$callback$$){const $id_app$$=$req$$.query.id_app;participant.referredUsers($id_app$$,$req$$.query.by||$req$$.user.email).then($report$$=>{$report$$.joinModel2($id_app$$,participant,[{where:{user:"email"},fields:["name"]}],function(){$callback$$(null,$report$$)})}).catch($e$$=>{$callback$$($e$$)})})};