Skip to content

Commit

Permalink
fix(request log): fix an issue where no params showed as binary data …
Browse files Browse the repository at this point in the history
…in request log
  • Loading branch information
morsdyce committed May 26, 2018
1 parent 51c7663 commit 1ca3cc4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ui/components/RequestLogs/RequestRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import find from 'lodash/find';
import isString from 'lodash/isString';
import isNull from 'lodash/isNull';
import isUndefined from 'lodash/isUndefined';
import get from 'lodash/get';
import API from 'api';
import UIState from 'ui/states/UIState';
Expand Down Expand Up @@ -76,6 +77,8 @@ const editRequest = (request) => (event) => {
UIState.setViewMode('mocks');
};

const isNullOrUndefined = (value) => isNull(value) || isUndefined(value);

const RequestRow = ({ request, onSelect, selected, getCellWidth, query }) => {
const body = get(request, 'mock.response.body', request.response.body);

Expand Down Expand Up @@ -106,7 +109,7 @@ const RequestRow = ({ request, onSelect, selected, getCellWidth, query }) => {
</Cell>

<Cell width={getCellWidth('params')} cell="params">
{ !isString(request.params) && !isNull(request.params) ? 'binary data' : request.params }
{ !isString(request.params) && !isNullOrUndefined(request.params) ? 'binary data' : request.params }
</Cell>

<Cell width={getCellWidth('status')} cell="status">
Expand All @@ -118,7 +121,7 @@ const RequestRow = ({ request, onSelect, selected, getCellWidth, query }) => {
</Cell>

<Cell>
{ !isString(body) && !isNull(body) ? 'binary data' : body }
{ !isString(body) && !isNullOrUndefined(body) ? 'binary data' : body }
</Cell>

{
Expand Down

0 comments on commit 1ca3cc4

Please sign in to comment.