mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 17:18:32 +02:00
Fix chaining multiple requests together.
Fixes https://yaak.app/feedback/posts/request-chaining-issue-on-cold-start
This commit is contained in:
@@ -72,6 +72,10 @@ export const plugin: PluginDefinition = {
|
|||||||
name: 'header',
|
name: 'header',
|
||||||
label: 'Header Name',
|
label: 'Header Name',
|
||||||
async dynamic(ctx, args) {
|
async dynamic(ctx, args) {
|
||||||
|
// Dynamic form config also runs during send-time rendering.
|
||||||
|
// Keep this preview-only to avoid side-effect request sends.
|
||||||
|
if (args.purpose !== 'preview') return null;
|
||||||
|
|
||||||
const response = await getResponse(ctx, {
|
const response = await getResponse(ctx, {
|
||||||
requestId: String(args.values.request || ''),
|
requestId: String(args.values.request || ''),
|
||||||
purpose: args.purpose,
|
purpose: args.purpose,
|
||||||
@@ -146,6 +150,10 @@ export const plugin: PluginDefinition = {
|
|||||||
label: 'JSONPath or XPath',
|
label: 'JSONPath or XPath',
|
||||||
placeholder: '$.books[0].id or /books[0]/id',
|
placeholder: '$.books[0].id or /books[0]/id',
|
||||||
dynamic: async (ctx, args) => {
|
dynamic: async (ctx, args) => {
|
||||||
|
// Dynamic form config also runs during send-time rendering.
|
||||||
|
// Keep this preview-only to avoid side-effect request sends.
|
||||||
|
if (args.purpose !== 'preview') return null;
|
||||||
|
|
||||||
const resp = await getResponse(ctx, {
|
const resp = await getResponse(ctx, {
|
||||||
requestId: String(args.values.request || ''),
|
requestId: String(args.values.request || ''),
|
||||||
purpose: 'preview',
|
purpose: 'preview',
|
||||||
|
|||||||
Reference in New Issue
Block a user