Skip to content

Commit

Permalink
fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
wheelsandcogs committed Oct 1, 2024
1 parent b0ca04f commit 1ac4744
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/controllers/dimension-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const validateDimensionCreationRequest = async (
}
footnotes = sourceInfo;
break;
case SourceType.DIMENSION:
case SourceType.Dimension:
dimensions.push(sourceInfo);
break;
case SourceType.IGNORE:
case SourceType.Ignore:
ignore.push(sourceInfo);
break;
default:
Expand All @@ -59,16 +59,16 @@ export const validateDimensionCreationRequest = async (

async function createUpdateDatavalues(sourceDescriptor: DimensionCreationDTO) {
const dataValuesSource = await Source.findOneByOrFail({ id: sourceDescriptor.sourceId });
dataValuesSource.action = SourceAction.CREATE;
dataValuesSource.type = SourceType.DATAVALUES;
dataValuesSource.action = SourceAction.Create;
dataValuesSource.type = SourceType.DataValues;
await Source.createQueryBuilder().relation(Source, 'dimension').of(dataValuesSource).set(null);
await dataValuesSource.save();
}

async function createUpdateIngoredSources(sourceDescriptor: DimensionCreationDTO) {
const ignoreSource = await Source.findOneByOrFail({ id: sourceDescriptor.sourceId });
ignoreSource.action = SourceAction.IGNORE;
ignoreSource.type = SourceType.IGNORE;
ignoreSource.action = SourceAction.Ignore;
ignoreSource.type = SourceType.Ignore;
await Source.createQueryBuilder().relation(Source, 'dimension').of(ignoreSource).set(null);
await ignoreSource.save();
}
Expand All @@ -80,11 +80,11 @@ async function createUpdateFootnotesDimension(
sourceDescriptor: DimensionCreationDTO
) {
const footnoteSource = await Source.findOneByOrFail({ id: sourceDescriptor.sourceId });
if (footnoteSource.type !== SourceType.FOOTNOTES) {
footnoteSource.type = SourceType.FOOTNOTES;
if (footnoteSource.type !== SourceType.FootNotes) {
footnoteSource.type = SourceType.FootNotes;
}
const existingFootnotesDimension = existingDimensions.find(
(dimension) => dimension.type === DimensionType.FOOTNOTE
(dimension) => dimension.type === DimensionType.FootNote
);
if (existingFootnotesDimension) {
footnoteSource.dimension = Promise.resolve(existingFootnotesDimension);
Expand Down Expand Up @@ -120,7 +120,7 @@ async function createDimension(
) {
const checkSource = await Source.findOneByOrFail({ id: sourceDescriptor.sourceId });
const existingDimension = await checkSource.dimension;
if (existingDimension && checkSource.type === SourceType.DIMENSION) {
if (existingDimension && checkSource.type === SourceType.Dimension) {
logger.debug(`No Dimension to create as Source for column ${checkSource.csvField} is already attached to one`);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/route/dataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ router.delete(
const importRecord = await validateImport(importID, res);
if (!importRecord) return;
try {
if (importRecord.location === DataLocation.DATA_LAKE) {
if (importRecord.location === DataLocation.DataLake) {
logger.warn('User has requested to remove a fact table from the datalake. This is unusual.');
await removeFileFromDatalake(importRecord);
const sources = await importRecord.sources;
Expand Down
2 changes: 1 addition & 1 deletion test/publisher-journey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ describe('API Endpoints', () => {
const testFileImportId = crypto.randomUUID().toLowerCase();
await createSmallDataset(testDatasetId, testRevisionId, testFileImportId, user);
const importRecord = await FileImport.findOneByOrFail({ id: testFileImportId });
importRecord.location = DataLocation.DATA_LAKE;
importRecord.location = DataLocation.DataLake;
await importRecord.save();
DataLakeService.prototype.deleteFile = jest.fn().mockReturnValue(true);
const res = await request(app)
Expand Down

0 comments on commit 1ac4744

Please sign in to comment.