louie007 / loopback-paginator-mixin

LoopBack Pagination Mixin
MIT License
2 stars 0 forks source link

Duplicate meta tags #1

Open ghguy opened 5 years ago

ghguy commented 5 years ago

Hi,

We are using your mixin and found that for the model that we configured -

"mixins": { "Paginator": { "limit": 5, "maxLimit": 50, "noMaxLimit": true, "firstPage": true } },

And inside model-config.json -

"_meta": { "sources": [ "loopback/common/models", "loopback/server/models", "../common/models", "./models", "../node_modules/loopback-component-passport/lib/models" ], "mixins": [ "loopback/common/mixins", "../node_modules/loopback-paginator-mixin/lib", "loopback/server/mixins", "../common/mixins", "./mixins", "./node_modules/loopback-component-passport/lib/models" ] },

The results we got is like the following (truncated for simplicity sake) -

{ "data": { "data": [ { "id": 1, "appId": 0, "key1": "string", ... (truncated)... "key20": "string" } } ], "meta": { "totalItemCount": 3, "totalPageCount": 1, "itemsPerPage": 5, "currentPage": 1 } }, "meta": { "totalItemCount": 3, "totalPageCount": 1, "itemsPerPage": 5, "currentPage": 1 } }

Note that the meta tags as well as the root data elements were repeated twice.

The following are the main dependencies in our package.json -

... "dependencies": { "chalk": "^2.4.2", "compression": "^1.0.3", "connect-ensure-login": "^0.1.1", "cookie-parser": "^1.4.4", "cors": "^2.5.2", "debug": "^4.1.1", "dotenv": "^8.0.0", "express": "^4.17.1", "express-flash": "0.0.2", "express-jwt": "^5.3.1", "express-session": "^1.16.2", "google-auth-library": "^5.1.2", "helmet": "^3.11.0", "jade": "^1.11.0", "jwks-rsa": "^1.6.0", "loopback": "^3.26.0", "loopback-boot": "^2.28.0", "loopback-component-explorer": "^6.4.0", "loopback-component-passport": "^3.11.0", "loopback-component-roles": "^1.0.1", "loopback-connector-mysql": "^5.4.2", "loopback-context": "^3.4.0", "loopback-paginator-mixin": "^2.1.3", "oasgraph-cli": "^0.4.3", "passport-facebook": "^3.0.0", "passport-google-oauth": "^2.0.0", "passport-local": "^1.0.0", "passport-oauth2": "^1.5.0", "path": "^0.12.7", "pug": "^2.0.4", "serve-favicon": "^2.0.1", "strong-error-handler": "^2.0.0" }, ...

Could you advise on how to resolve this?

Thank you!

koliapp2019 commented 4 years ago

Any update in this?