UNPKG

flexbiz-server

Version:

Flexible Server

3 lines (2 loc) 880 B
'use strict';const model=global.getModel("fbconversation"),controller=require("../../controllers/controller"),fbconversation=function($router$$){(new controller($router$$,model,"fbconversation",{sort:{updated_time:-1},unique:["page_id","id"],onCreating:($user$$,$data$$,$callback$$)=>{if(!$user$$.appAdmin)return $callback$$("B\u1ea1n kh\u00f4ng c\u00f3 quy\u1ec1n th\u1ef1c hi\u1ec7n t\u00e1c v\u1ee5 n\u00e0y");$callback$$(null,$data$$)},onUpdating:($user$$,$data$$,$obj$$,$callback$$)=>{if(!$user$$.appAdmin)return $callback$$("B\u1ea1n kh\u00f4ng c\u00f3 quy\u1ec1n th\u1ef1c hi\u1ec7n t\u00e1c v\u1ee5 n\u00e0y"); $callback$$(null,$data$$,$obj$$)},onView:async($user$$,$items$$,$next$$)=>{await $items$$.asyncJoinModel2($user$$.current_id_app,global.getModel("fbpage"),{where:"page_id",fields:"page_title"});$next$$(null,$items$$)}})).route()};module.exports=fbconversation;