Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaitasaini committed Jan 17, 2025
1 parent 1299241 commit 6e5ed47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions services/ui-src/src/components/report/StatusTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import lookupIconPrimary from "assets/icons/search/icon_search_primary.svg";
import { ParentPageTemplate } from "types/report";
import { TableStatusIcon } from "components/tables/TableStatusIcon";
import { reportBasePath } from "utils/other/routing";
import { submitReport } from "utils/api/requestMethods/report";

export const StatusTableElement = () => {
const { pageMap, report, user } = useStore();
Expand Down Expand Up @@ -99,6 +100,7 @@ export const StatusTableElement = () => {
<Button
// onClick={() => SetPageIndex(parentPage.index - 1)}
alignSelf="flex-end"
onClick={async () => submitReport(report!)}
>
Submit QMS Report
</Button>
Expand Down
5 changes: 4 additions & 1 deletion services/ui-src/src/utils/api/requestMethods/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export async function submitReport(report: Report) {
headers: { ...requestHeaders },
body: { ...report },
};
return await apiLib.post(`/reports/${report.type}/${report.state}`, options);
return await apiLib.post(
`/reports/submit/${report.type}/${report.state}`,
options
);
}

export async function getReportsForState(reportType: string, state: string) {
Expand Down

0 comments on commit 6e5ed47

Please sign in to comment.