rockq-org / austack-core

API, Console, Test of austack
32 stars 8 forks source link

enable GET /api/applications #66

Closed hailiang-wang closed 9 years ago

hailiang-wang commented 9 years ago

Description

lymanlai commented 9 years ago

support pages require auth for admin, dave can only retrieve his own apps for root, peter can retrieve all apps

hailiang-wang commented 9 years ago

@lymanlai After reading the codes, I think a refactor with the query related codes. First, if GET /api/apps?page=10&limit=100, page=10 and limit=100 also pass into the query, not only the option.

In application.controller, parse the query and options

image

options are gotten from query too

image

In mongoose-paginage.js, the query is used directly.

image

conclusion

The query string passed into paginate should have better format.

hailiang-wang commented 9 years ago

Refactor task #122 for query