Skip to content

Commit

Permalink
Ignore updator in api/*/get for consistency (fix #156)
Browse files Browse the repository at this point in the history
  • Loading branch information
edemaine committed Mar 16, 2021
1 parent 2e4d6b9 commit 8a34895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ Responses often include "presence" objects which consist of two fields:

## Query Operations

For consistency with other API calls, query operations can specify an
`updator` field, which is ignored.

### `/api/meeting/get`: Fetch data for one or more meetings

Request fields: (either `meeting` or `meetings` is required)
Expand Down
5 changes: 4 additions & 1 deletion server/api.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ checker =
room: checkRoom
tab: checkTab
apiGet = (type) -> (options) ->
delete options.updator # for consistency across different API calls
"#{type}s": Meteor.call "#{type}Get", options
apiNew = (type) -> (options) ->
## /api/meeting/new cannot require secret, but other operations do
Expand Down Expand Up @@ -70,7 +71,9 @@ apiMethods =
'/meeting/edit': apiEdit 'meeting'
'/room/edit': apiEdit 'room'
'/tab/edit': apiEdit 'tab'
'/log/get': (options) -> logs: Meteor.call 'logGet', options
'/log/get': (options) ->
delete options.updator # for consistency across different API calls
logs: Meteor.call 'logGet', options

## Allow CORS for API calls
WebApp.rawConnectHandlers.use '/api', (req, res, next) ->
Expand Down

0 comments on commit 8a34895

Please sign in to comment.