Skip to content

Commit

Permalink
followup query hits the right route
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed May 5, 2022
1 parent 98983ae commit dce7d74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,17 @@ function getDataFromAxiosResponse(res: AxiosResponse, path: string | string[]) {

export async function fetchFollowUpQuestions(
categoryId: string,
mentorId: string,
accessToken: string,
classifierLambdaEndpoint?: string
): Promise<FollowUpQuestion[]> {
return execHttp<FollowUpQuestion[]>(
"POST",
urljoin(
classifierLambdaEndpoint || CLASSIFIER_ENTRYPOINT,
"me",
"followups",
"category",
categoryId,
mentorId
categoryId
),
{ accessToken, dataPath: "followups" }
);
Expand Down
3 changes: 1 addition & 2 deletions client/src/hooks/graphql/use-with-followups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ export function useWithFollowups(props: {
const curCategory = curSubject?.categories.find((c) => c.id === categoryId);

function fetchFollowups() {
if (!loginState.accessToken || !mentorId) {
if (!loginState.accessToken) {
return;
}
dispatch({ type: FollowupsActionType.GENERATING_FOLLOWUPS });
fetchFollowUpQuestions(
categoryId,
mentorId,
loginState.accessToken,
configState?.config?.classifierLambdaEndpoint
)
Expand Down
2 changes: 1 addition & 1 deletion cypress/cypress/support/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export function cyMockFollowUpQuestions(
} = {}
): void {
params = params || {};
cy.intercept("POST", "/classifier/followups/*/*/*", (req) => {
cy.intercept("POST", "/classifier/me/followups/*/*", (req) => {
req.alias = "followups";
req.reply(
staticResponse({
Expand Down

0 comments on commit dce7d74

Please sign in to comment.