Skip to content

Commit 5bae021

Browse files
committed
fixup! feat(dref-translation): update dref status and publish api to approve
1 parent 64907e5 commit 5bae021

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/src/views/DrefFinalReportForm/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ export function Component() {
305305
method: 'PATCH',
306306
pathVariables: isDefined(finalReportId) ? { id: finalReportId } : undefined,
307307
body: (formFields: FinalReportRequestBody) => formFields,
308+
useCurrentLanguageForMutation: true,
308309
onSuccess: (response) => {
309310
alert.show(
310311
strings.formSaveRequestSuccessMessage,

app/src/views/DrefOperationalUpdateForm/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import NonFieldError from '#components/NonFieldError';
4343
import Page from '#components/Page';
4444
import useCurrentLanguage from '#hooks/domain/useCurrentLanguage';
4545
import useAlert from '#hooks/useAlert';
46+
import { DREF_STATUS_APPROVED } from '#utils/constants';
4647
import {
4748
type GoApiResponse,
4849
useLazyRequest,
@@ -313,7 +314,7 @@ export function Component() {
313314
const prevOperationalUpdateId = useMemo(() => {
314315
const currentOpsUpdate = drefResponse
315316
?.operational_update_details
316-
?.find((ou) => !ou.is_published);
317+
?.find((ou) => !(ou.status === DREF_STATUS_APPROVED));
317318

318319
if (isNotDefined(currentOpsUpdate)) {
319320
return undefined;
@@ -344,6 +345,7 @@ export function Component() {
344345
} = useLazyRequest({
345346
url: '/api/v2/dref-op-update/{id}/',
346347
method: 'PATCH',
348+
useCurrentLanguageForMutation: true,
347349
pathVariables: isDefined(opsUpdateId) ? { id: opsUpdateId } : undefined,
348350
body: (formFields: OpsUpdateRequestBody) => formFields,
349351
onSuccess: (response) => {

0 commit comments

Comments
 (0)