Makes sure routes don't overlap and yield a header set error (#2559)
This commit is contained in:
@@ -18,6 +18,9 @@ export class UsersRouter extends ClassesRouter {
|
||||
}
|
||||
|
||||
handleGet(req) {
|
||||
if (req.params.objectId === 'me') {
|
||||
return this.handleMe(req);
|
||||
}
|
||||
req.params.className = '_User';
|
||||
return super.handleGet(req);
|
||||
}
|
||||
@@ -198,7 +201,6 @@ export class UsersRouter extends ClassesRouter {
|
||||
mountRoutes() {
|
||||
this.route('GET', '/users', req => { return this.handleFind(req); });
|
||||
this.route('POST', '/users', req => { return this.handleCreate(req); });
|
||||
this.route('GET', '/users/me', req => { return this.handleMe(req); });
|
||||
this.route('GET', '/users/:objectId', req => { return this.handleGet(req); });
|
||||
this.route('PUT', '/users/:objectId', req => { return this.handleUpdate(req); });
|
||||
this.route('DELETE', '/users/:objectId', req => { return this.handleDelete(req); });
|
||||
|
||||
Reference in New Issue
Block a user