@@ -257,80 +257,10 @@ export default function TRPCComposer(props) {
257257
258258 const sendRequest = async ( ) => {
259259 const id = uuid ( ) ;
260- // const headers = newRequest.newRequestHeaders.headersArr.filter(
261- // (x) => x.active
262- // );
263- // const cookie = cookiesArr.filter((x) => x.active);
264- // const reqRes = {
265- // id,
266- // createdAt: new Date(),
267- // protocol,
268- // trpc: true,
269- // url: 'http://localhost:3000/trpc',
270- // graphQL,
271- // gRPC,
272- // webrtc,
273- // timeSent: null,
274- // timeReceived: null,
275- // connection: 'uninitialized',
276- // connectionType: null,
277- // checkSelected: false,
278- // host: 'http://localhost:3000',
279- // request: {
280- // method,
281- // headers,
282- // procedures,
283- // bodyType,
284- // rawType,
285- // network,
286- // restUrl,
287- // wsUrl,
288- // gqlUrl,
289- // cookie,
290- // },
291- // response: {
292- // cookies: [],
293- // headers: {},
294- // stream: null,
295- // events: [],
296- // },
297- // checked: false,
298- // minimized: false,
299- // tab: currentTab,
300- // };
301-
302- const cache = [
303- {
304- method : 'MUTATE' ,
305- endpoint : 'update' ,
306- variable : '{\n "userId": "1",\n "name": "nguyen"\n }' ,
307- } ,
308- { method : 'QUERY' , endpoint : 'sayHi' , variable : '' } ,
309- {
310- method : 'MUTATE' ,
311- endpoint : 'log' ,
312- variable : '"HELLO WORLD"' ,
313- } ,
314- {
315- method : 'QUERY' ,
316- endpoint : 'secretData' ,
317- variable : '{\n "userId": "1",\n "name": "justin"\n }' ,
318- } ,
319- {
320- method : 'QUERY' ,
321- endpoint : 'BLAHBLAH.BLAH' ,
322- variable : '{\n "userId": "1",\n "name": "justin"\n }' ,
323- } ,
324- ] ;
325-
326- const cookiCache = [
327- { id : 'cookie0' , active : true , key : 'cookie1' , value : 'cookie1Val' } ,
328- { id : 'cookie1' , active : true , key : 'cookie2' , value : 'cookie2Val' } ,
329- ] ;
330- const headerCache = [
331- { id : 351217.45631817693 , active : true , key : 'auth1' , value : 'auth2' } ,
332- { id : 87384.65282544694 , active : true , key : 'auth3' , value : 'auth4' } ,
333- ] ;
260+ const headers = newRequest . newRequestHeaders . headersArr . filter (
261+ ( x ) => x . active
262+ ) ;
263+ const cookie = cookiesArr . filter ( ( x ) => x . active ) ;
334264 const reqRes = {
335265 id,
336266 createdAt : new Date ( ) ,
@@ -348,26 +278,96 @@ export default function TRPCComposer(props) {
348278 host : 'http://localhost:3000' ,
349279 request : {
350280 method,
351- headers : headerCache ,
352- procedures : cache ,
281+ headers,
282+ procedures,
353283 bodyType,
354284 rawType,
355285 network,
356286 restUrl,
357287 wsUrl,
358288 gqlUrl,
359- cookie : cookiCache ,
289+ cookie,
360290 } ,
361291 response : {
362292 cookies : [ ] ,
363- headers : [ ] ,
293+ headers : { } ,
364294 stream : null ,
365295 events : [ ] ,
366296 } ,
367297 checked : false ,
368298 minimized : false ,
369299 tab : currentTab ,
370300 } ;
301+
302+ // const cache = [
303+ // {
304+ // method: 'MUTATE',
305+ // endpoint: 'update',
306+ // variable: '{\n "userId": "1",\n "name": "nguyen"\n }',
307+ // },
308+ // { method: 'QUERY', endpoint: 'sayHi', variable: '' },
309+ // {
310+ // method: 'MUTATE',
311+ // endpoint: 'log',
312+ // variable: '"HELLO WORLD"',
313+ // },
314+ // {
315+ // method: 'QUERY',
316+ // endpoint: 'secretData',
317+ // variable: '{\n "userId": "1",\n "name": "justin"\n }',
318+ // },
319+ // {
320+ // method: 'QUERY',
321+ // endpoint: 'BLAHBLAH.BLAH',
322+ // variable: '{\n "userId": "1",\n "name": "justin"\n }',
323+ // },
324+ // ];
325+
326+ // const cookiCache = [
327+ // { id: 'cookie0', active: true, key: 'cookie1', value: 'cookie1Val' },
328+ // { id: 'cookie1', active: true, key: 'cookie2', value: 'cookie2Val' },
329+ // ];
330+ // const headerCache = [
331+ // { id: 351217.45631817693, active: true, key: 'auth1', value: 'auth2' },
332+ // { id: 87384.65282544694, active: true, key: 'auth3', value: 'auth4' },
333+ // ];
334+ // const reqRes = {
335+ // id,
336+ // createdAt: new Date(),
337+ // protocol,
338+ // trpc: true,
339+ // url: 'http://localhost:3000/trpc',
340+ // graphQL,
341+ // gRPC,
342+ // webrtc,
343+ // timeSent: null,
344+ // timeReceived: null,
345+ // connection: 'uninitialized',
346+ // connectionType: null,
347+ // checkSelected: false,
348+ // host: 'http://localhost:3000',
349+ // request: {
350+ // method,
351+ // headers: headerCache,
352+ // procedures: cache,
353+ // bodyType,
354+ // rawType,
355+ // network,
356+ // restUrl,
357+ // wsUrl,
358+ // gqlUrl,
359+ // cookie: cookiCache,
360+ // },
361+ // response: {
362+ // cookies: [],
363+ // headers: [],
364+ // stream: null,
365+ // events: [],
366+ // },
367+ // checked: false,
368+ // minimized: false,
369+ // tab: currentTab,
370+ // };
371371 // add request to history
372372 historyController . addHistoryToIndexedDb ( reqRes ) ;
373373 reqResItemAdded ( reqRes ) ;
0 commit comments