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

Pagination support and also support ?whereIn= in the query string #15

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
85b06d4
Update index.js
nabilfreeman Apr 27, 2017
ada9998
Merge pull request #1 from lesalonapp/fix-before-undefined-error
marineMB Jun 26, 2019
2b44e26
Add pagination in get for collections
marineMB Jul 4, 2019
373b240
Add package-lock to gitignore
marineMB Jul 4, 2019
4ad1fce
Add query.load in links
marineMB Jul 5, 2019
cd2b6e7
Remove useless async/await to use only promises
marineMB Jul 8, 2019
b3d4c23
Split objects to improve dev reading experience
marineMB Jul 8, 2019
1094a10
Remove comments
marineMB Jul 8, 2019
3920335
Add promises to get totalPages and pagination
marineMB Jul 8, 2019
de6a18c
Offset is the number of rows that we skip...
marineMB Jul 8, 2019
66fa597
Improve code by using promise chaining
marineMB Jul 8, 2019
a35ea91
Add comments
marineMB Jul 8, 2019
cc468a6
Add eslint
marineMB Jul 8, 2019
cde8831
Eslint index.js
marineMB Jul 8, 2019
8f3a34f
Merge pull request #2 from lesalonapp/improve-dashboard-perf
MarieFindlay Jul 9, 2019
5ac22ea
Update package.json
nabilfreeman Jul 11, 2019
05f5605
when counting the number of pages, clone the model so we don't accide…
nabilfreeman Jul 17, 2019
981cef2
chain orderBy, limit, offset onto the original model
nabilfreeman Jul 17, 2019
c8c8f7f
By hardcoding the structure of the query we excluded where. Also, thi…
nabilfreeman Jul 17, 2019
389090f
initialize the model outside of the where query check, I think this i…
nabilfreeman Jul 17, 2019
ebe523a
Add qs to package.json and bump version
nabilfreeman Jul 17, 2019
bb168b4
Merge pull request #3 from lesalonapp/pagination-where-crash
nabilfreeman Jul 17, 2019
ebe2092
Add conditional looking for a whereIn in the query
runticle Oct 21, 2021
b67431b
really annoying to test this
runticle Oct 21, 2021
180c144
Improve json comment example
nabilfreeman Oct 22, 2021
98aa706
Merge pull request #4 from lesalonapp/Allow-whereIn-in-the-query
nabilfreeman Oct 22, 2021
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
52 changes: 52 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
},
extends: [
'airbnb-base',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
ecmaVersion: 2018,
},
rules: {
"import/no-named-as-default-member": 0,
"import/no-named-as-default": 0,
"no-tabs": 0,
"camelcase": 0,
"no-console": 0,
"no-param-reassign": 0,
"import/prefer-default-export": 0,
"consistent-return": 0,
"max-len": 0,
"no-continue": 0,
'no-case-declarations': 0,
"indent": [2, "tab", { "SwitchCase": 1, "VariableDeclarator": 1 }],
"class-methods-use-this": 0,
"no-restricted-syntax": 0,
"prefer-template": 0,
"no-plusplus": 0,
"default-case": 0,
"no-useless-constructor": 0,
"jsx-a11y/accessible-emoji": 0,
"no-use-before-define": 0,
"curly": 0,
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"prefer-destructuring": 0,
"no-await-in-loop": 0,
"global-require": 0,
"func-names": 0,
"linebreak-style": 0,
"no-empty-function": 0,
"no-labels": 0,
"func-names": 0,
"guard-for-in": 0,
"radix": 0,
"import/no-dynamic-require": 0,
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ build/Release
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
package-lock.json

# Users Environment Variables
.lock-wscript
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.autoFixOnSave": true
}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kalamata",
"version": "0.1.4",
"version": "0.2.0",
"description": "Extensible REST API for Express + Bookshelf.js",
"homepage": "https://github.com/mikec/kalamata",
"bugs": "https://github.com/mikec/kalamata/issues",
Expand All @@ -22,14 +22,18 @@
"bookshelf": "^0.10"
},
"devDependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-plugin-import": "^2.18.0",
"grunt": "0.4.5",
"grunt-contrib-watch": "0.6.1",
"grunt-jasmine-node": "git://github.com/fiznool/grunt-jasmine-node.git#c773421b608ce944454cb540a6e66575d2df09c6",
"load-grunt-tasks": "0.6.0"
},
"dependencies": {
"body-parser": "^1.9.0",
"bluebird": "^3"
"bluebird": "^3",
"qs": "^6.7.0"
},
"scripts": {
"test": "grunt"
Expand Down
Loading