Skip to content

Commit 8d4bda6

Browse files
committed
fix(location): Simplify location data model
1 parent c181ed9 commit 8d4bda6

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

src/locations/elisa-appelsiini.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ module.exports = {
66
"In addition to being a silver sponsor of the event, Elisa is supporting the event by providing space for our workshops",
77
image: "sponsors/elisa.svg",
88
social: sponsor.social,
9-
location: {
10-
country: {
11-
name: "Finland",
12-
code: "FI",
13-
},
14-
city: "Helsinki",
15-
address: "Kaarlenkatu 11",
9+
country: {
10+
name: "Finland",
11+
code: "FI",
1612
},
13+
city: "Helsinki",
14+
address: "Kaarlenkatu 11",
1715
keywords: sponsor.keywords
1816
};

src/locations/valkoinen-sali.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ module.exports = {
55
social: {
66
homepage: "http://www.valkoinensali.com/",
77
},
8-
location: {
9-
country: {
10-
name: "Finland",
11-
code: "FI",
12-
},
13-
city: "Helsinki",
14-
address: "Aleksanterinkatu 16",
8+
country: {
9+
name: "Finland",
10+
code: "FI",
1511
},
12+
city: "Helsinki",
13+
address: "Aleksanterinkatu 16",
1614
};

src/type-defs.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ module.exports = `
3131
speakers: [Contact],
3232
tickets: [Ticket],
3333
keywords: [String],
34-
location: Location
34+
country: Country,
35+
city: String,
36+
address: String
3537
}
3638
3739
type Page {

tests.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ assert.equal(
88
"Andrey Okonetchnikov"
99
);
1010

11+
assert.equal(
12+
content.workshops.find(o => o.title === "Styleguide-driven Development")
13+
.location.address,
14+
"Aleksanterinkatu 16"
15+
);
16+
1117
assert.equal(
1218
content.speakers.find(o => o.name === "Andrey Okonetchnikov").workshops[0]
1319
.title,
@@ -42,7 +48,7 @@ assert.equal(
4248
);
4349

4450
assert.equal(
45-
content.locations.find(o => o.name === "Valkoinen Sali").location.address,
51+
content.locations.find(o => o.name === "Valkoinen Sali").address,
4652
"Aleksanterinkatu 16"
4753
);
4854

0 commit comments

Comments
 (0)