sharkio-dev / sharkio

Sharkio is an API proxy for your development environments. It records all the requests that are sent to your API. It allows you to replay the requests easily. Generate types, documentation, test suites, And interact with your API using AI.
https://sharkio.dev/
MIT License
5 stars 1 forks source link

Allow add multiple invocation to flow #453

Closed Tamir198 closed 8 months ago

Tamir198 commented 8 months ago

You can now select invocations and add them to a flow.

https://github.com/sharkio-dev/sharkio/assets/34707669/65454672-4c3e-40b3-91d7-5d7117438255

Tamir198 commented 8 months ago

Answer to both comments - if I would change the types into some thing like this :

type ImportToFlowDialogProps = {
  setIsImportStepDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
  isImportStepDialogOpen: boolean;
  invocations: InvocationType[];
  iconSize: number;
};

 <ImportToFlowDialog
                setIsImportStepDialogOpen={setIsImportStepDialogOpen}
                isImportStepDialogOpen={isImportStepDialogOpen}
                invocations={[invocation]}
                iconSize={15}
              />

Then in this line:

                invocations={[invocation]}

I would get this ts error :

image

This is because on the same page InvocationSectionProps.invocation is of type InvocationType | undefined:

image

This is being used all over the file so I figured that it's better to change 1 type to fit the system than refactor everything.

What do you think?

ypotter commented 8 months ago
type ImportToFlowDialogProps = {
  setIsImportStepDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
  isImportStepDialogOpen: boolean;
  invocations: InvocationType[];
  iconSize: number;
};

If you don't have an invocation, just don't allow to import.