Skip to content

Commit 7de52e0

Browse files
committed
fix(sync): rename address_line_1 field in data
1 parent 0ad72eb commit 7de52e0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/service-content/src/lib/events/import/main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface EventMain {
1919
remaining_seats: number;
2020
book_online: boolean;
2121
book_in_person: boolean;
22-
address_line_1: string;
22+
address_city_country: string;
2323
address_line_2: string;
2424
address_line_3: string;
2525
professor: string;
@@ -90,7 +90,7 @@ export const createProcessMainFile = (transaction: TransactionSql) => {
9090
${parsedEvent.available_seats},
9191
${parsedEvent.book_online},
9292
${parsedEvent.book_in_person},
93-
${parsedEvent.address_line_1},
93+
${parsedEvent.address_city_country},
9494
${parsedEvent.address_line_2},
9595
${parsedEvent.address_line_3},
9696
${parsedEvent.professor},

packages/service-content/src/lib/resources/import/categories/books.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export const createProcessChangedBook = (
9393
RETURNING *;
9494
`.then(firstRow);
9595

96-
if (p.contributors_id) {
97-
for (const [index, contrib] of p.contributors_id.entries()) {
96+
if (p.contributor_names) {
97+
for (const [index, contrib] of p.contributor_names.entries()) {
9898
await transaction`INSERT INTO content.contributors (id) VALUES (${contrib}) ON CONFLICT DO NOTHING`;
9999
await transaction`
100100
INSERT INTO content.proofreading_contributor(proofreading_id, contributor_id, "order")

packages/service-content/src/lib/resources/import/categories/projects.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface ProjectMain {
1919
github?: string;
2020
nostr?: string;
2121
};
22-
address_line_1: string;
22+
address_city_country: string;
2323
address_line_2: string;
2424
address_line_3: string;
2525
original_language: string;
@@ -70,7 +70,7 @@ export const createProcessChangedProject = (
7070
VALUES (
7171
${parsedProject.id},${resourceId}, ${parsedProject.name}, ${parsedProject.category.toLowerCase()}, ${parsedProject.language},
7272
${parsedProject.links.website}, ${parsedProject.links.twitter},
73-
${parsedProject.links.github}, ${parsedProject.links.nostr}, ${parsedProject.address_line_1}, ${parsedProject.address_line_2}, ${parsedProject.address_line_3}, ${parsedProject.original_language}
73+
${parsedProject.links.github}, ${parsedProject.links.nostr}, ${parsedProject.address_city_country}, ${parsedProject.address_line_2}, ${parsedProject.address_line_3}, ${parsedProject.original_language}
7474
)
7575
ON CONFLICT (id) DO UPDATE SET
7676
resource_id = EXCLUDED.resource_id,
@@ -97,8 +97,8 @@ export const createProcessChangedProject = (
9797
RETURNING *;
9898
`.then(firstRow);
9999

100-
if (p.contributors_id) {
101-
for (const [index, contrib] of p.contributors_id.entries()) {
100+
if (p.contributor_names) {
101+
for (const [index, contrib] of p.contributor_names.entries()) {
102102
await transaction`INSERT INTO content.contributors (id) VALUES (${contrib}) ON CONFLICT DO NOTHING`;
103103
await transaction`
104104
INSERT INTO content.proofreading_contributor(proofreading_id, contributor_id, "order")

0 commit comments

Comments
 (0)