Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a 'generic' serialize method, useful to use with web sockets. #15

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8abff87
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
1e68a3a
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
610d202
fix for web sockets not going
oiramalli Jul 21, 2016
23bfdc0
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
6065732
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
18dc298
fix for web sockets not going
oiramalli Jul 21, 2016
d3e7317
Merge branch 'generalSerializer' of https://github.com/oiramalli/sail…
oiramalli Jul 22, 2016
a832828
Cleaning up files
oiramalli Jul 22, 2016
f911673
Some more cleanup
oiramalli Jul 22, 2016
670e70a
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
a39ca95
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
66a7511
fix for web sockets not going
oiramalli Jul 21, 2016
aafc544
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
74a11e7
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
ebc65e5
Cleaning up files
oiramalli Jul 22, 2016
00a9216
Some more cleanup
oiramalli Jul 22, 2016
17c219f
Merge branch 'generalSerializer' of https://github.com/oiramalli/sail…
oiramalli Jul 22, 2016
39502f3
Some more cleanup...
oiramalli Jul 22, 2016
310fd23
Some more cleanup...
oiramalli Jul 22, 2016
8921274
Some more cleanup...
oiramalli Jul 22, 2016
18dd697
wait for normalizePayload to call next()
oiramalli Jul 26, 2016
00fd1fa
Serializer
oiramalli Dec 8, 2016
4e5dafd
Code cleanup
oiramalli Feb 8, 2017
39acb87
Some changes on serializer
oiramalli Feb 8, 2017
c674306
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
fb203e0
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
30c2afc
fix for web sockets not going
oiramalli Jul 21, 2016
af50ac4
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
a63972d
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
dc32182
Cleaning up files
oiramalli Jul 22, 2016
81e9997
Some more cleanup
oiramalli Jul 22, 2016
b7c6ef6
Created a serialaze 'generic' method.
oiramalli Jul 21, 2016
15d00b3
fix to to override the input on the config/jsonapi.js file
oiramalli Jul 21, 2016
acbdc08
Merge branch 'generalSerializer' of https://github.com/oiramalli/sail…
oiramalli Feb 8, 2017
f345004
Removing extra spaces
oiramalli Feb 8, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ module.exports = function jsonApiHook(sails) {
if (req.isSocket) return next();
addResponseMethods(req, res);
normalizePayload(req, next);
next();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/serializer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use strict';

const JSONAPISerializer = require('jsonapi-serializer').Serializer;
var JSONAPISerializer = require('jsonapi-serializer').Serializer;

module.exports = function (modelName, data) {
let sails = this.req._sails;
let sailsModel = sails.models[modelName];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed. It's used several times. Causing your tests to fail.

try {
if (!sailsModel || typeof sailsModel === 'undefined') {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"url": "https://github.com/IanVS/sails-hook-jsonapi"
},
"dependencies": {
"jsonapi-serializer": "^3.2.1",
"jsonapi-serializer": "^3.3.0",
"lodash": "^4.13.1",
"pluralize": "^1.2.1",
"sails-build-dictionary": "^0.10.1"
Expand Down