Skip to content

Commit

Permalink
fix: updated submission detail endpoint and params
Browse files Browse the repository at this point in the history
  • Loading branch information
sujanadh committed Mar 4, 2024
1 parent 8327de0 commit 140c6fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ const SubmissionsTable = ({ toggleView }) => {
const [paginationPage, setPaginationPage] = useState<number>(1);
const [submittedBy, setSubmittedBy] = useState<string | null>(null);

const encodedTaskId = environment.encode(3468);

useEffect(() => {
let count = 0;
const filters = Object.keys(filter);
Expand Down Expand Up @@ -436,7 +434,7 @@ const SubmissionsTable = ({ toggleView }) => {
<AssetModules.VisibilityOutlinedIcon
className="fmtm-text-[#545454] hover:fmtm-text-primaryRed"
onClick={() => {
navigate(`/project/${encodedId}/tasks/${encodedTaskId}/submission/${row?.meta?.instanceID}`);
navigate(`/project/${encodedId}/tasks/${row?.phonenumber}/submission/${row?.meta?.instanceID}`);
}}
/>{' '}
<span className="fmtm-text-primaryRed fmtm-border-[1px] fmtm-border-primaryRed fmtm-mx-1"></span>{' '}
Expand Down
7 changes: 3 additions & 4 deletions src/frontend/src/views/SubmissionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const SubmissionDetails = () => {
const params = CoreModules.useParams();
const encodedProjectId = params.projectId;
const decodedProjectId = environment.decode(encodedProjectId);
const encodedTaskId = params.taskId;
const decodedTaskId = environment.decode(encodedTaskId);
const taskId = params.taskId;
const paramsInstanceId = params.instanceId;

const submissionDetails = useAppSelector((state) => state.submission.submissionDetails);
Expand All @@ -20,10 +19,10 @@ const SubmissionDetails = () => {
SubmissionService(
`${
import.meta.env.VITE_API_URL
}/central/submission?project_id=${decodedProjectId}&xmlFormId=${decodedTaskId}&submission_id=${paramsInstanceId}`,
}/submission/task_submissions/${decodedProjectId}?task_id=${taskId}&submission_id=${paramsInstanceId}`,
),
);
}, []);
}, [decodedProjectId, taskId, paramsInstanceId]);

function removeNullValues(obj) {
const newObj = {};
Expand Down

0 comments on commit 140c6fc

Please sign in to comment.