@@ -19,9 +19,7 @@ import HeaderEntryForm from '../sharedComponents/requestForms/HeaderEntryForm';
1919import CookieEntryForm from '../sharedComponents/requestForms/CookieEntryForm' ;
2020import TRPCProceduresContainer from './TRPCProceduresContainer' ;
2121
22- import Store from '../../../toolkit-refactor/store' ;
2322import TRPCSubscriptionContainer from './TRPCSubscriptionContainer' ;
24- import { error } from 'console' ;
2523import { responseDataSaved } from '../../../toolkit-refactor/slices/reqResSlice' ;
2624
2725/**
@@ -78,20 +76,16 @@ function reducer(procedures, action) {
7876
7977export default function TRPCComposer ( props ) {
8078 const dispatch = useDispatch ( ) ;
81- // /** newRequestBody slice from redux store, contains specific request info */
82- // const requestBody = useSelector(
83- // (state: RootState) => state.newRequest.newRequestBody
84- // );
79+
8580 const [ showSubscription , setShowSubscription ] = useState ( false ) ;
8681 const subscriptionHandler = ( bool ) => {
8782 setShowSubscription ( bool ) ;
8883 } ;
8984 const [ procedures , proceduresDipatch ] = useReducer ( reducer , [
9085 PROCEDURE_DEFAULT ,
9186 ] ) ;
87+
9288 const {
93- composerFieldsReset,
94- fieldsReplaced,
9589 newRequestFields,
9690 newRequestFields : {
9791 gRPC,
@@ -105,7 +99,6 @@ export default function TRPCComposer(props) {
10599 network,
106100 method,
107101 } ,
108- newRequestBodySet,
109102 newRequestBody,
110103 newRequestBody : { rawType, bodyType } ,
111104 newRequestHeadersSet,
@@ -117,9 +110,7 @@ export default function TRPCComposer(props) {
117110 newRequestStreams,
118111 currentTab,
119112 setWarningMessage,
120- warningMessage,
121113 reqResItemAdded,
122- setWorkspaceActiveTab,
123114 } = props ;
124115
125116 /** newRequestFields slice from redux store, contains general request info*/
@@ -177,75 +168,6 @@ export default function TRPCComposer(props) {
177168 tab : currentTab ,
178169 } ;
179170
180- // const cache = [
181- // {
182- // method: 'MUTATE',
183- // endpoint: 'update',
184- // variable: '{\n "userId": "1",\n "name": "nguyen"\n }',
185- // },
186- // { method: 'QUERY', endpoint: 'sayHi', variable: '' },
187- // {
188- // method: 'MUTATE',
189- // endpoint: 'log',
190- // variable: '"HELLO WORLD"',
191- // },
192- // {
193- // method: 'QUERY',
194- // endpoint: 'secretData',
195- // variable: '{\n "userId": "1",\n "name": "justin"\n }',
196- // },
197- // {
198- // method: 'QUERY',
199- // endpoint: 'BLAHBLAH.BLAH',
200- // variable: '{\n "userId": "1",\n "name": "justin"\n }',
201- // },
202- // ];
203-
204- // const cookiCache = [
205- // { id: 'cookie0', active: true, key: 'cookie1', value: 'cookie1Val' },
206- // { id: 'cookie1', active: true, key: 'cookie2', value: 'cookie2Val' },
207- // ];
208- // const headerCache = [
209- // { id: 351217.45631817693, active: true, key: 'auth1', value: 'auth2' },
210- // { id: 87384.65282544694, active: true, key: 'auth3', value: 'auth4' },
211- // ];
212- // const reqRes = {
213- // id,
214- // createdAt: new Date(),
215- // protocol,
216- // trpc: true,
217- // url: 'http://localhost:3000/trpc',
218- // graphQL,
219- // gRPC,
220- // webrtc,
221- // timeSent: null,
222- // timeReceived: null,
223- // connection: 'uninitialized',
224- // connectionType: null,
225- // checkSelected: false,
226- // host: 'http://localhost:3000',
227- // request: {
228- // method,
229- // headers: headerCache,
230- // procedures: cache,
231- // bodyType,
232- // rawType,
233- // network,
234- // restUrl,
235- // wsUrl,
236- // gqlUrl,
237- // cookie: cookiCache,
238- // },
239- // response: {
240- // cookies: [],
241- // headers: [],
242- // stream: null,
243- // events: [],
244- // },
245- // checked: false,
246- // minimized: false,
247- // tab: currentTab,
248- // };
249171 // add request to history
250172 historyController . addHistoryToIndexedDb ( reqRes ) ;
251173 reqResItemAdded ( reqRes ) ;
@@ -254,7 +176,7 @@ export default function TRPCComposer(props) {
254176 // composerFieldsReset();
255177 // connectionController.openReqRes(reqRes.id);
256178 dispatch ( responseDataSaved ( reqRes ) ) ;
257- trpcController . sendRequest ( reqRes ) ;
179+ connectionController . openReqRes ( reqRes . id ) ;
258180 } ;
259181
260182 return (
0 commit comments