How can I use Sails.js actionUtil.js in my controller?

Melwin Kieffer

I generated an api building using sails command line and now I would like to customize logic inside route /building. I checked sails source code to replicate the basic behaviour of find action with my customizations.

I saw that the very convenient library actionUtil is used to perform this action and I would like to reuse this file in my controller. How can I do that ?

My final goal is just to display buildings which user has access to, if you have a better idea than replicate sails source code, I'm in !

Thanks

Santosh Gali

You can import it in your controller or wherever you need it with just specifying full path for e.g

var actionUtil = require('sails/lib/hooks/blueprints/actionUtil');

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I use stored procedure call in sails js?

How can I use Sails.js without Waterline?

How do I use a variable in Js controller to my HTML

How can I declare a const string in my Stimulus JS controller?

How can I send arguments into my controller ASP from JS?

How do I install and use Vue.js with Sails JS?

Sails js: How can I define two MySQL connections to two different databases in a single model in Sails js?

How can I test the Sails.js v1.0 login controller with CSRF security enabled (using mocha, supertest)?

How can I use shorthand if else statement in my js code

How can I use the flask.Response in my JS code?

How I can use my jquery plugin in Next.js?

How can i use script parameters into my js file?

How can I use this local .txt file in my js code?

Sails JS ignore controller

How can I customize create in controller in Sails

How can I filter populated values in sails.js?

How can i enable csrf for GET requests in SAILS js

how can I integrate sails.js with compass?

Can I use controller in other controller in angular js?

Sails.Js - How I do pagination in sails.Js

Sails.js: how to use i18n function in assets/js/files.js

I can't use a JS script in my HTML with Vue js

How can I bundle my tests which use Sinon.js using Rollup.js?

How to use import Leaflet in Sails.js?

How to use Validations in sails.js?

I can't get populate() to work on my sails.js project

Sails.js - Issues with controller

npm start is starting the server.js not my React app, how can I use it to start my app?

How can I use a Spring HttpRequest in my controller?