Skip to content

Commit cee3b18

Browse files
committed
fix: map CSV sector column to pillar field on import
The import-export-entries plugin matches CSV columns to DB fields by name. The output CSV had a "sector" column but the DB field is "pillar", so the relation was never written. Destructure sector from the parsed row and write it as pillar in the transformed output.
1 parent 045774a commit cee3b18

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cms/src/api/project/services/project.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,12 @@ export default factories.createCoreService("api::project.project", {
220220
);
221221
const publishedAt = new Date().toISOString();
222222

223+
const { sector, ...rowWithoutSector } = row;
223224
const updatedRow: any = {
224-
...row,
225+
...rowWithoutSector,
225226
countries: countryIds,
226227
sdgs: sdgIds,
227-
sector: pillarIds,
228+
pillar: pillarIds,
228229
status,
229230
source_country: sourceCountry,
230231
objective,

0 commit comments

Comments
 (0)