Cleanup
This commit is contained in:
parent
f491029c21
commit
56a6db7d2a
|
@ -36,6 +36,7 @@ class SocketProvider extends React.Component<Props> {
|
|||
});
|
||||
this.socket.on('unauthorized', err => {
|
||||
ui.showToast(err.message);
|
||||
throw err;
|
||||
});
|
||||
this.socket.on('entities', event => {
|
||||
if (event.documents) {
|
||||
|
|
|
@ -12,10 +12,6 @@ import Toasts from 'components/Toasts';
|
|||
import Theme from 'components/Theme';
|
||||
import Routes from './routes';
|
||||
|
||||
// socket.on('connect', function(){});
|
||||
// socket.on('event', function(data){});
|
||||
// socket.on('disconnect', function(){});
|
||||
|
||||
let DevTools;
|
||||
if (__DEV__) {
|
||||
DevTools = require('mobx-react-devtools').default; // eslint-disable-line global-require
|
||||
|
|
|
@ -324,11 +324,9 @@ router.post('documents.revisions', auth(), pagination(), async ctx => {
|
|||
limit: ctx.state.pagination.limit,
|
||||
});
|
||||
|
||||
const data = await Promise.all(revisions.map(presentRevision));
|
||||
|
||||
ctx.body = {
|
||||
pagination: ctx.state.pagination,
|
||||
data,
|
||||
data: revisions.map(presentRevision)
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -22,11 +22,9 @@ router.post('integrations.list', auth(), pagination(), async ctx => {
|
|||
limit: ctx.state.pagination.limit,
|
||||
});
|
||||
|
||||
const data = await Promise.all(integrations.map(presentIntegration));
|
||||
|
||||
ctx.body = {
|
||||
pagination: ctx.state.pagination,
|
||||
data,
|
||||
data: integrations.map(presentIntegration),
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ router.post('users.list', auth(), pagination(), async ctx => {
|
|||
});
|
||||
|
||||
router.post('users.info', auth(), async ctx => {
|
||||
ctx.body = { data: await presentUser(ctx.state.user) };
|
||||
ctx.body = {
|
||||
data: presentUser(ctx.state.user),
|
||||
};
|
||||
});
|
||||
|
||||
router.post('users.update', auth(), async ctx => {
|
||||
|
@ -48,7 +50,9 @@ router.post('users.update', auth(), async ctx => {
|
|||
|
||||
await user.save();
|
||||
|
||||
ctx.body = { data: await presentUser(user, { includeDetails: true }) };
|
||||
ctx.body = {
|
||||
data: presentUser(user, { includeDetails: true }),
|
||||
};
|
||||
});
|
||||
|
||||
router.post('users.s3Upload', auth(), async ctx => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import presentUser from './user';
|
||||
|
||||
it('presents a user', async () => {
|
||||
const user = await presentUser({
|
||||
const user = presentUser({
|
||||
id: '123',
|
||||
name: 'Test User',
|
||||
username: 'testuser',
|
||||
|
@ -15,7 +15,7 @@ it('presents a user', async () => {
|
|||
});
|
||||
|
||||
it('presents a user without slack data', async () => {
|
||||
const user = await presentUser({
|
||||
const user = presentUser({
|
||||
id: '123',
|
||||
name: 'Test User',
|
||||
username: 'testuser',
|
||||
|
|
Reference in New Issue