修改 /api/factories 的回傳格式,一次回傳 factories, documents 與 report_records 減少前端需要的 query 次數 #491
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/api/statistics/factories
參數有
前三個是之前就有的就不多解釋,最主要就是多了一個 level
level 可以接受的值是
city
與town
e.g.
/api/statistics/factories
回傳全台灣的資料,但是不會有縣市與鄉鎮市區的資料
/api/statistics/factories?level=city
回傳全台灣與縣市資料
/api/statistics/factories?level=town
回傳全台灣, 縣市與鄉鎮市區的資料
如果跟 townname 結合的話
/api/statistics/factories?townname=臺南市&level=town
/api/statistics/factories?townname=臺南市善化區
/api/statistics/factories?townname=臺南市