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

Allow using shared extractors #54

Merged
merged 12 commits into from
Mar 20, 2024
Merged

Allow using shared extractors #54

merged 12 commits into from
Mar 20, 2024

Conversation

eyurtsev
Copy link
Collaborator

@eyurtsev eyurtsev commented Mar 20, 2024

Allow using shared extractors.

This won't work with current version of backend due to cookies not being passed

@eyurtsev eyurtsev marked this pull request as ready for review March 20, 2024 19:54
@eyurtsev eyurtsev requested review from ccurme and bracesproul March 20, 2024 19:55
@eyurtsev
Copy link
Collaborator Author

@ccurme creating a separate endpoint for the shared extractor. I am not 100% sure this is the way to go, but was thinking about trying to keep the semantics clear about when we're using something shared vs. not

@eyurtsev
Copy link
Collaborator Author

#55

Comment on lines 75 to 77
type ExtractionResponse = {
data: unknown[];
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this data structure actually unknown? If possible we should type it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also build failing because unknown is not assignable to Record<string, any>[].

Three options:

  1. switch type to Record<string, any>[] if we know the response will always be a dict, then this is valid
  2. switch to any[]
  3. add typing for the response object

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I'll adjust in a bit

@@ -21,6 +21,9 @@ type GetExtractorQueryKey = [string, string, boolean]; // [queryKey, uuid, isSha

type OnSuccessFn = (data: { uuid: string }) => void;

axios.defaults.withCredentials = true;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bracesproul I will need your help to figure out how to do this correctly later on. For now going to merge to get unblocked

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other way to do it would be via the config object when actually performing the axios request:

const response = await axios.get(`${baseUrl}/shared/extractors/${uuid}`, {
  withCredentials: true,
});

@eyurtsev eyurtsev mentioned this pull request Mar 20, 2024
41 tasks
@eyurtsev eyurtsev merged commit 6e80282 into main Mar 20, 2024
9 checks passed
@eyurtsev eyurtsev deleted the eugene/make_run_shared branch March 20, 2024 21:04
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

Successfully merging this pull request may close these issues.

2 participants