Skip to content

Commit

Permalink
renames selectQueryVersion to setQueryVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
thewahome committed Oct 15, 2019
1 parent 058abe0 commit 05b42e6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/app/services/actions/query-input-action-creators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function setSampleQuery(response: IQuery): IAction {
};
}

export function selectQueryVersion(response: IQuery): IAction {
export function setQueryVersion(response: IQuery): IAction {
return {
type: SELECT_VERSION_SUCCESS,
response,
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/query-runner/QueryRunner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class QueryRunner extends Component<
const requestUrl = urlObject.pathname.substr(5).replace(/\/$/, '');
const sampleUrl = `${GRAPH_URL}/${option.text + requestUrl + decodeURI(urlObject.search)}`;

this.props.actions!.selectQueryVersion(option.text);
this.props.actions!.setQueryVersion(option.text);
this.props.actions!.setSampleQuery({
...sampleQuery,
sampleUrl
Expand Down
4 changes: 2 additions & 2 deletions src/app/views/sidebar/history/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class History extends Component<IHistoryProps, any> {
if (sampleQuery.selectedVerb === 'GET') {
sampleQuery.sampleBody = JSON.parse('{}');
}
actions.selectQueryVersion(queryVersion);
actions.setQueryVersion(queryVersion);
actions.setSampleQuery(sampleQuery);
actions.runQuery(sampleQuery);
}
Expand All @@ -273,7 +273,7 @@ export class History extends Component<IHistoryProps, any> {
};

if (actions) {
actions.selectQueryVersion(queryVersion);
actions.setQueryVersion(queryVersion);
actions.setSampleQuery(sampleQuery);
actions.viewHistoryItem({
body: query.result,
Expand Down
2 changes: 1 addition & 1 deletion src/app/views/sidebar/sample-queries/SampleQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class SampleQueries extends Component<ISampleQueriesProps, any> {
};

if (actions) {
actions.selectQueryVersion(queryVersion);
actions.setQueryVersion(queryVersion);
if (sampleQuery.selectedVerb === 'GET') {
sampleQuery.sampleBody = JSON.parse('{}');
actions.runQuery(sampleQuery);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import configureMockStore from 'redux-mock-store';
import thunk from 'redux-thunk';

import { selectQueryVersion, setSampleQuery } from '../../../app/services/actions/query-input-action-creators';
import { setQueryVersion, setSampleQuery } from '../../../app/services/actions/query-input-action-creators';
import { SELECT_VERSION_SUCCESS, SET_SAMPLE_QUERY_SUCCESS } from '../../../app/services/redux-constants';

const middlewares = [thunk];
Expand Down Expand Up @@ -33,7 +33,7 @@ describe('actions', () => {
expect(store.getActions()).toEqual(expectedActions);
});

it('creates SELECT_VERSION_SUCCESS when selectQueryVersion is called', () => {
it('creates SELECT_VERSION_SUCCESS when setQueryVersion is called', () => {
const expectedActions = [
{
type: SELECT_VERSION_SUCCESS,
Expand All @@ -44,7 +44,7 @@ describe('actions', () => {
const store = mockStore({ selectedVersion: 'v1.0' });

// @ts-ignore
store.dispatch(selectQueryVersion('beta'));
store.dispatch(setQueryVersion('beta'));
expect(store.getActions()).toEqual(expectedActions);
});

Expand Down
2 changes: 1 addition & 1 deletion src/types/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IHistoryProps {
setSampleQuery: Function;
removeHistoryItem: Function;
viewHistoryItem: Function;
selectQueryVersion: Function;
setQueryVersion: Function;
};
theme?: ITheme;
styles?: object;
Expand Down
4 changes: 2 additions & 2 deletions src/types/query-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IQueryRunnerProps {
runQuery: Function;
addRequestHeader: Function;
setSampleQuery: Function;
selectQueryVersion: Function;
setQueryVersion: Function;
};
}

Expand Down Expand Up @@ -87,6 +87,6 @@ export interface ISampleQueriesProps {
runQuery: Function;
setSampleQuery: Function;
fetchSamples: Function;
selectQueryVersion: Function;
setQueryVersion: Function;
};
}

0 comments on commit 05b42e6

Please sign in to comment.