Skip to content

Commit

Permalink
Putting a file back
Browse files Browse the repository at this point in the history
  • Loading branch information
kobelb authored and legrego committed Jun 22, 2018
1 parent b5cd7f6 commit 4524222
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import _ from 'lodash';
import Boom from 'boom';
import { getClient } from '../../../../../../../server/lib/get_client_shield';
import { roleSchema } from '../../../../lib/role_schema';
import { wrapError } from '../../../../lib/errors';
import { routePreCheckLicense } from '../../../../lib/route_pre_check_license';
import { getClient } from '../../../../../../server/lib/get_client_shield';
import { roleSchema } from '../../../lib/role_schema';
import { wrapError } from '../../../lib/errors';
import { routePreCheckLicense } from '../../../lib/route_pre_check_license';

export function initRolesApi(server) {
const callWithRequest = getClient(server).callWithRequest;
Expand All @@ -21,9 +21,7 @@ export function initRolesApi(server) {
handler(request, reply) {
return callWithRequest(request, 'shield.getRole').then(
(response) => {
const roles = _.map(response, (role, name) => {
return _.assign(role, { name });
});
const roles = _.map(response, (role, name) => _.assign(role, { name }));

return reply(roles);
},
Expand Down Expand Up @@ -58,7 +56,6 @@ export function initRolesApi(server) {
handler(request, reply) {
const name = request.params.name;
const body = _.omit(request.payload, 'name');

return callWithRequest(request, 'shield.putRole', { name, body }).then(
() => reply(request.payload),
_.flow(wrapError, reply));
Expand Down

0 comments on commit 4524222

Please sign in to comment.