1

Currently i have all my routes in Sails to be pluralized because im using ember. However i have an issue where Sails is not pluralizing a word properly.

I have a quiz model, and when i do a findAll on quiz it returns nothing. Come to find out after attempting to visit my sails endpoint /api/v1/quizzes i get nothing back. So i went ahead and tried /api/v1/quizs and it returns to me

{ "quizzes": [ array, of, my, quizzes] }

Does anyone know how i can force SailsJS to give the correct pluralized endpoint? Or do i need to just create the endpoint manually to return the data?

NodeDad
  • 1,519
  • 2
  • 19
  • 48
  • 1
    I hope the answer below helps. If you would like an additional resource, here is a chat room for sails.js, node.js, and waterline questions. https://gitter.im/balderdashy/sails – Travis Webb Aug 12 '15 at 02:53

1 Answers1

2

I believe you just need to override the blueprints routes and use custom routes for the quiz api

# routes.js

'get /quizzes/:id?': 'QuizController.find',
'post /quizzes': 'QuizController.create',
'put /quizzes/:id': 'QuizController.update',
'delete /quizzes/:id': 'QuizController.destroy',
Justin
  • 36
  • 1