...
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.
------------------------------------------------------
module.exports = { test: (req, res) => res.json({ it: 'works!'})}
it worked for GET 'http://localhost:1337/v1/demo/test
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? @mikermcneil Help me please.
user has memberships: { collection: 'club', via: 'members' }
. and club has members: { collection: 'user', via: 'memberships' }
. I can get them to work for the development only shortcut routes GET /:modelIdentity/:id/:association/add/:fk
, however i don't want to use shortcut routes. i want to use the example PUT /club/:id/members/add/:fk
with :id being the club id and :fk being the user id and it keeps giving me not found. i'm sure i'm doing it wrong, but the boat / driver example is a little confusing. can anyone offer advice?
PUT /:modelIdentity/:id/:association/:fk
works beautifully