Skip to content

Commit

Permalink
fix(*): fixed backoffice state for directors with no documents (#3001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy authored Jan 29, 2025
1 parent b19f6b8 commit f12145e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ export const useDirectorBlock = ({

const blocks = useMemo(() => {
const { documents } = director;
const documentsWithoutImageUrl = documents.map(document => ({
const documentsWithoutImageUrl = documents?.map(document => ({
...document,
pages: document?.pages?.map(({ imageUrl: _imageUrl, ...page }) => page),
}));
const isDocumentRevision = documents.some(
const isDocumentRevision = documents?.some(
document => document?.decision?.status === 'revision',
);
const multiDocumentsBlocks = documents.flatMap(document => {
const multiDocumentsBlocks = documents?.flatMap(document => {
const isDoneWithRevision = document?.decision?.status === 'revised';
const additionalProperties = composePickableCategoryType(
document.category,
Expand Down Expand Up @@ -438,7 +438,7 @@ export const useDirectorBlock = ({
.buildFlat(),
})
.build()
.concat(multiDocumentsBlocks)
.concat(multiDocumentsBlocks ?? [])
.concat(amlBlockWithSeparator)
.flat(1),
className: ctw({
Expand Down
2 changes: 1 addition & 1 deletion services/workflows-service/prisma/data-migrations

0 comments on commit f12145e

Please sign in to comment.