riedeljan / insomnia-universal-git

An Insomnia plugin that aims to help with managing your collections over git
https://exaspace.de
MIT License
17 stars 5 forks source link

Request: Multiple Collections Support #7

Open UnicodeTreason opened 3 years ago

UnicodeTreason commented 3 years ago

I have many collections, to keep all my API work organised. image

If i configure my Zabbix collection to save to file Zabbix.json image

I would expect to be able to go into my MessageNet collection and configure that to save to a different file. But currently its tries to save it to Zabbix.json as well. image

If I change the form to say MessageNet.json in the MessageNet collection, then the Zabbix collection also starts saving to MessageNet.json

UnicodeTreason commented 3 years ago

Thoughts:

DCCoder90 commented 3 years ago

The thought of storing each workspace in a separate file seems easy enough. The plugin could potentially simply store each workspace in a workspaceName-insomnia.json file.

We could modify the providers to accept a workspace name and then modify the pushWorkspace function in index.tsx to pass the "filename" such as:

models.workspace.name+'-insomnia.json'

But for the pullWorkspace method, would have to loop through every file in a repository and see if it ends with '-insomnia.json' and only pull those files (to keep from just pulling down random files).

Taking this route would effectively eliminate the need to configure the workspace file name from the user; However, this could cause issues if people want to store the requests in the same repository as a corresponding project with a standard name.

lautit commented 1 year ago

Hi!

I'm having the same issue, currently working around it by changing the config file name manually, but it triggers a frontend reload every time.

My +1, will try to review the code and find a solution.