Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send a tabid along with query in POST request #209

Open
eric-personal opened this issue Oct 6, 2022 · 0 comments
Open

Send a tabid along with query in POST request #209

eric-personal opened this issue Oct 6, 2022 · 0 comments

Comments

@eric-personal
Copy link

Hi I'm trying to add an id to the post request. Currently the payload is query: ..... I also want to add and {id:value} along with the query. I'm using React and saving an instance of yasgui in a ref.

I've tried to do it in 2 places of my code to add the id before the POST happens.

The first approach does not work at all.

yasgui.current.on("query", onHandleQueryStart);
 
  const onHandleQueryStart = (instance, tab) => {
      instance.config.requestConfig.args = [
        {
          name: "id",
          value: getSelectedTabId(),
        },
      ];
  },

The second approach kind of works except its ignoring the first tab when added. Then all added tabs after that it adds the last id to the newly added tab.

  const onTabAdded = (tab, tabId) => {
      tab.config.requestConfig.args = [
        {
          name: "id",
          value: tabId,
        },
      ];
    }

Is there a correct way to add a tabId to the Post request before it gets submitted ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant