Skip to content

Commit

Permalink
fix revisit
Browse files Browse the repository at this point in the history
  • Loading branch information
wheelsandcogs committed Nov 1, 2024
1 parent df8cc51 commit 31411c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/controllers/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const uploadFile = async (req: Request, res: Response, next: NextFunction

export const importPreview = async (req: Request, res: Response, next: NextFunction) => {
const { dataset, revision, fileImport } = res.locals;
const revisit = dataset.dimensions?.length > 0;
let errors: ViewErrDTO | undefined;
let previewData: ViewDTO | undefined;
let ignoredCount = 0;
Expand All @@ -91,6 +90,9 @@ export const importPreview = async (req: Request, res: Response, next: NextFunct
return;
}

// if sources have previously been assigned a type, this is a revisit
const revisit = fileImport.sources?.filter((source: SourceDTO) => Boolean(source.type)).length > 0;

if (req.method === 'POST') {
try {
if (req.body.confirm === 'true') {
Expand Down Expand Up @@ -123,7 +125,7 @@ export const importPreview = async (req: Request, res: Response, next: NextFunct

export const sources = async (req: Request, res: Response, next: NextFunction) => {
const { dataset, revision, fileImport } = res.locals;
const revisit = dataset.dimensions?.length > 0;
const revisit = fileImport.sources?.filter((source: SourceDTO) => Boolean(source.type)).length > 0;
let error: ViewError | undefined;
let errors: ViewErrDTO | undefined;
let currentImport = fileImport;
Expand Down

0 comments on commit 31411c6

Please sign in to comment.