Skip to content

Commit

Permalink
Merge pull request #151 from coronasafe/testsuite-q
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashesh3 authored Dec 9, 2023
2 parents de422d3 + 32d7d77 commit fa236d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/admin/tests/[testsuite_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Page({ params }: { params: { testsuite_id: string } }) {
const testSuite: TestSuite | undefined = testSuiteQuery.data || undefined;

const TestQuestionsQuery = useQuery(["testsuitequestion", testsuite_id], () =>
API.tests.questions.list(testsuite_id, { ordering: "created_at" })
API.tests.questions.list(testsuite_id, { ordering: "created_at", limit: 100 })
, { refetchOnWindowFocus: false });
const testQuestions: TestQuestion[] | undefined =
TestQuestionsQuery.data?.results || undefined;
Expand Down
14 changes: 7 additions & 7 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ export const API = {
request("auth/reset", "POST", { token, email, password }),
},
projects: {
assistant:{
assistant: {
list:
(project_id: string) => request(`projects/${project_id}/list_assistants`, "GET"),
(project_id: string) => request(`projects/${project_id}/list_assistants`, "GET"),
create: (project_id: string, assistant: Partial<any>) => request(`projects/${project_id}/create_assistant`, "POST", assistant),
},
list: (
Expand Down Expand Up @@ -278,11 +278,11 @@ export const API = {
fetch: string;
} = { limit, offset, search, fetch: "all" }
) => request(`projects/${project_id}/chats`, "GET", filters),
get: (project_id: string, id: string, filters:{
get: (project_id: string, id: string, filters: {
fetch: string;
} = {
fetch: "all"
}) =>
} = {
fetch: "all"
}) =>
request(`projects/${project_id}/chats/${id}`, "GET", filters),
update: (project_id: string, id: string, fields: ChatUpdateFields) =>
request(`projects/${project_id}/chats/${id}`, "PATCH", fields),
Expand Down Expand Up @@ -332,7 +332,7 @@ export const API = {
questions: {
list: (
suite_id: string,
filters: { ordering: string } = { ordering: "-created_at" }
filters: { ordering: string, limit: number } = { ordering: "-created_at", limit: 100 }
) => request(`tests/suites/${suite_id}/questions`, "GET", filters),
create: (suite_id: string, question: Partial<TestQuestion>) =>
request(`tests/suites/${suite_id}/questions`, "POST", { ...question }),
Expand Down

1 comment on commit fa236d9

@vercel
Copy link

@vercel vercel bot commented on fa236d9 Dec 9, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.