Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
brookesb91
@brookesb91
@mp3por I haven’t had time to try and replicate your issue yet but I can try later - In the meantime take a look here => https://github.com/balderdashy/sails/issues
Usually someone gets back pretty quickly
Eric Maddox
@maddtech
With the new sails 1.0, where is code that requires some pages be logged in and other not to be logged in?
Velin Kerkov
@mp3por
@brookesb91 10x
brookesb91
@brookesb91
@mp3por sails-mysql can support JSON types in the database - was there anything else you needed to know?
@maddtech You’ll want to look at policies for tat
Mukul Sharma
@mukulsoftwap
i have try sails.js v 1 and choose web app option in cmd , how can i use rest api
Eric Maddox
@maddtech
@brookesb91 Thx, I think I am starting to see how it works now.
brookesb91
@brookesb91
@maddtech no problem!
Daniel Harvey
@danielsharvey
@maddtech Also check the https://ration.io/ / https://github.com/mikermcneil/ration example
Eric Maddox
@maddtech
@danielsharvey will do!
brookesb91
@brookesb91
@danielsharvey +1 for that - hadn’t seen it before - cheers!
Daniel Harvey
@danielsharvey
@brookesb91 No problems. It's a nice app demonstrating a fair number of features. For me, the todo is to get passportjs working with Sail 1.0...
Velin Kerkov
@mp3por
@brookesb91 the way I did it is { type: "ref", columnType: "JSON" } however this translates into column with type "longtext"
@danielsharvey whats the problem ... i got this shit done
brookesb91
@brookesb91
@mp3por That’s fine, the datatypes on top don’t fully reflect the db type - yu can set it explicitly if you wish
Velin Kerkov
@mp3por
not really. My biggest problem is the mongodb + mysql thing. I remember I had the same issue with redis + mysql
@brookesb91
Marco Romano
@marcorom88_twitter
hi everyone. It is possible made a model with an action that's works well on web app and app android both? So, for android I needs response json, and on web app I have some redirect for rendering page. It is possible made single api that works fine on both scenarios? Or for android I needs other api for made response JSON? Thanks!
John Wolfe
@wolfejw86
@marcorom88_twitter can you check for req.wantsJSON and then conditionally send the response as json or a view ?
Marco Romano
@marcorom88_twitter
thanks, seems to be works. I'm new to sails js and I'm learning now how works.
Konstantin Burkalev
@KSDaemon
Hello! May be someone can help me: why req.acceptedLanguages is undefined? I have a policy which check it, and now it is broken…
Abirlal Biswas
@abirlalb_twitter
I am facing issue during databse connection
it is inserting fdata
Mike McNeil
@mikermcneil
@KSDaemon i'm looking into it now
The change to john resig's lighter-weight i18n package changed some stuff and I believe our docs slipped out of date there (verifying now to be sure). In the mean time, check out https://github.com/sgress454/sails-hook-i18n
Mike McNeil
@mikermcneil
Mike McNeil
@mikermcneil
@KSDaemon related to balderdashy/sails#4343
Mike McNeil
@mikermcneil
@KSDaemon ok just double-checked: you'll want to use req.acceptsLanguages()
(i'll add mention of this to the upgrading guide tomorrow morning)
Konstantin Burkalev
@KSDaemon
@mikermcneil Yep! Thanks for your answer, yesterday night i figured that out, but had no power to write about it. I saw also that express.js had this attribute in 3.x versions, but that was removed in 4.x.
brookesb91
@brookesb91
With the lifecycle callbacks on models, is it possible to get the current values for the object?
this.somevalue always returns undefined -
Philip Feldmann
@philipfeldmann
Hello there. Is there a way targeting a policy on the default blueprint api? My goal is to keep the blueprint API in production available for 'admin' only.
Hamza
@hamzaOp
Hello everyone ! , I want to access a controller from the sails object but sails.controllers returns undefined , I'm using 1.0 , it's working on 0.12.
brookesb91
@brookesb91
@hamzaOp are you using actions2 for controllers? If so, they aren’t registered as classic controllers. You could require() them or move the logic into a helper and it’ll be callable from anywhere
Hamza
@hamzaOp
@brookesb91 no I'm using classic actions
Osmel Guarepo
@osmelg
good morning :)
brookesb91
@brookesb91
@hamzaOp Do you definitely need to access the controller? Is there a possibilty to move logic into a helper instead?
Hamza
@hamzaOp
@brookesb91 yes , but I just want to understand the problem , I console log the sails object but it returns 0 controllers , it's like the controllers are not registered.
fabianforce
@fabianforce
Hi who can tell me how to read a local json file in sails v1 ?
brookesb91
@brookesb91
@hamzaOp I believe what you are looking for is controllers.moduleDefinitions
Philip Feldmann
@philipfeldmann
Is there any way to use the new es6 export default syntax for sails entities instead of module.exports? I've tried using babel-node and simply changing the syntax but my controllers will no longer be recognized.
Dean Hantzis
@professor-rage
not sure if this is a issue (not really a bug) in sails v1.0 or sails-postgresql - when using the postgres datastore - if you define a primary key in the model def, but the attribute definition for that pK doesn't include required: true, sails lifts without any error/warning. Only when you try to use that model in code OR when you stop the server do you get an error stating data store identity does not exist.
  ...
  primaryKey: 'id2',
  attributes: {
    id2: {
      type: 'number',
      required: true //if required:true is omited, sails lifts with no warning, but model is not accessible
    },
  }
  ...
    try {
      var a = await SomeModel.find().limit(10);
    } catch(err) {
      console.log(err)
    }
name: 'UsageError',
        code: 'E_INVALID_ARGINS',
        problems: [Array] } },
  isOperational: true,
  adapterMethodName: 'find',
  modelIdentity: 'SomeModel',
  raw: 
   { UsageError: Could not run select() because of 2 problems:
------------------------------------------------------"datastore" is required, but it was not defined.
• "models" is required, but it was not defined.
------------------------------------------------------
smihaljenovic
@smihaljenovic
@mikermcneil Hi Mike. Is it possible in v1.0 to dynamically change db connection and then use models to manipulate data?
newari
@newari
Hello everyone
In v0.12 I am able to create blueprint routes with controller subfolder path name but in v1.0 it's not working. For example, I have controller in v1 sub directory like /api/controller/v1/DemoController.js . For this blueprint autogenerated api path is /api/v1/demo in Sails v0.12 but its not working in v1. In Sails v1 its working on path /api/demo. Is there any solution of my problem?
John Wolfe
@wolfejw86
being very familiar with webpack but relatively unfamiliar with grunt, would anyone be able to tell me if the grunt buildProd task, while using the babel-polyfill works out of the box for async/await for your front end code? (in sails 1.0)