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

Release to val #1006

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions lib/packages/shared-types/opensearch/main/transforms/seatool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ const getRaiDate = (data: SeaTool) => {
const getDateStringOrNullFromEpoc = (epocDate: number | null | undefined) =>
epocDate !== null && epocDate !== undefined ? new Date(epocDate).toISOString() : null;

const compileSrtList = (
officers: SeatoolOfficer[] | null | undefined,
): { name: string; email: string }[] =>
officers?.length
? officers.map((o) => ({
name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`,
email: o.EMAIL || "",
}))
: [];
const compileSrtList = (
officers: SeatoolOfficer[] | null | undefined,
): { name: string; email: string }[] =>
officers?.length
? officers.map((o) => ({
name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`,
email: o.EMAIL || "",
}))
: [];

const getFinalDispositionDate = (status: string, record: SeaTool) => {
return status && finalDispositionStatuses.includes(status)
Expand Down Expand Up @@ -124,11 +124,13 @@ export const transform = (id: string) => {
: null;

const { stateStatus, cmsStatus } = getStatus(seatoolStatus);

const resp = {
id,
id: id.toUpperCase(),
actionType: data.ACTIONTYPES?.[0].ACTION_NAME,
approvedEffectiveDate: getDateStringOrNullFromEpoc(
data.STATE_PLAN.APPROVED_EFFECTIVE_DATE || data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE,
data.STATE_PLAN.APPROVED_EFFECTIVE_DATE ||
data.STATE_PLAN.ACTUAL_EFFECTIVE_DATE,
),
changed_date: data.STATE_PLAN.CHANGED_DATE,
description: data.STATE_PLAN.SUMMARY_MEMO,
Expand Down
5 changes: 2 additions & 3 deletions react-app/src/components/ActionForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ export const ActionForm = <Schema extends SchemaWithEnforcableProps>({
API.post("os", "/submit", {
body: formData,
}),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["record"] });
},
});

const onSubmit = form.handleSubmit(async (formData) => {
Expand Down Expand Up @@ -174,6 +171,8 @@ export const ActionForm = <Schema extends SchemaWithEnforcableProps>({
pathnameToDisplayOn: formOrigins.pathname,
});

// Prevent stale data from displaying on formOrigins page
await queryClient.invalidateQueries({ queryKey: ["record"] });
navigate(formOrigins);
} catch (error) {
console.error(error);
Expand Down
Loading