Skip to content

Commit

Permalink
add custom field mapping for geoX,geoY to point
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall committed Dec 17, 2024
1 parent 16f9471 commit a28c161
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/middleware/common.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,20 @@ export const removeIssuesThatHaveBeenFixed = async (req, res, next) => {
})
}

// some field mappings aren't in our database, so we should add them here
const customFieldMappings = [
{
field: 'GeoX,GeoY',
replacement_field: 'point'
}
]
export const addCustomFieldMappings = (req, res, next) => {
const { fieldMappings } = req

req.fieldMappings = [...fieldMappings, ...customFieldMappings]
next()
}

export const addFieldMappingsToIssue = (req, res, next) => {
const { issues, fieldMappings } = req

Expand Down Expand Up @@ -575,6 +589,7 @@ export const processRelevantIssuesMiddlewares = [
// however this step is very time consuming, so in order to progress im commenting it out for now
// removeIssuesThatHaveBeenFixed,
fetchFieldMappings,
addCustomFieldMappings,
addFieldMappingsToIssue
]

Expand Down

0 comments on commit a28c161

Please sign in to comment.