mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
a83596299a
* Improvements to Response tag recursion and rendering (Fixes #1500) * Add tests for response tag dependency sending
19 lines
664 B
JavaScript
19 lines
664 B
JavaScript
// @flow
|
|
|
|
import { send } from '../../network/network';
|
|
import type { Request } from '../../models/request';
|
|
import * as models from '../../models';
|
|
import type { ExtraRenderInfo } from '../../common/render';
|
|
|
|
export function init(activeEnvironmentId: string | null): { network: Object } {
|
|
const network = {
|
|
async sendRequest(request: Request, extraInfo?: ExtraRenderInfo): Promise<Response> {
|
|
const responsePatch = await send(request._id, activeEnvironmentId, extraInfo);
|
|
const settings = await models.settings.getOrCreate();
|
|
return models.response.create(responsePatch, settings.maxHistoryResponses);
|
|
},
|
|
};
|
|
|
|
return { network };
|
|
}
|