Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
fix(advocates): display whole country name in advocate cards (#3535)
Browse files Browse the repository at this point in the history
* fix(advocates): display whole country name in advocate cards

A bad type led to the first letter of a string being indexed instead of
the first string in an array of length one.

* test(advocates): update country property type

---------

Co-authored-by: Eddybrando Vásquez <[email protected]>
  • Loading branch information
jackoconnordev and eddybrando authored Jan 12, 2024
1 parent 8b365e5 commit cbe78bd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
:name="advocate.name"
:image="advocate.image"
:city="advocate.city"
:country="advocate.country[0]"
:country="advocate.country"
:region="advocate.region"
:slack-id="advocate.slackId"
:slack-username="advocate.slackUsername"
Expand Down
2 changes: 1 addition & 1 deletion hooks/advocate-conversion-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class AdvocatesAirtableRecords extends AirtableRecords {
return record.get(this.recordFields!.city);
}

public getCountry(record: any): string[] {
public getCountry(record: any): string {
return record.get(this.recordFields!.country);
}

Expand Down
8 changes: 4 additions & 4 deletions tests/hooks/utils/conversion-utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("writeJSONToFile", () => {
image: "/images/advocates/downloaded/rec8zXNiryVq3Q6kh.jpg",
region: "America (North)",
city: "New York",
country: ["United States"],
country: "United States",
slackId: "U017XULSMUY",
slackUsername: "John.Doe",
},
Expand All @@ -31,7 +31,7 @@ describe("writeJSONToFile", () => {
image: "/images/advocates/downloaded/recFKAk7KoXr3IMTH.jpg",
region: "America (North)",
city: "Durham",
country: ["United States"],
country: "United States",
slackId: "U01313A0AGP",
slackUsername: "J.Doe",
},
Expand Down Expand Up @@ -62,7 +62,7 @@ describe("writeJSONToFile", () => {
image: "/images/advocates/downloaded/rec8zXNiryVq3Q6kh.jpg",
region: "America (North)",
city: "New York",
country: ["United States"],
country: "United States",
slackId: "U017XULSMUY",
slackUsername: "J.Doe",
},
Expand All @@ -71,7 +71,7 @@ describe("writeJSONToFile", () => {
image: "/images/advocates/downloaded/recFKAk7KoXr3IMTH.jpg",
region: "America (North)",
city: "Durham",
country: ["United States"],
country: "United States",
slackId: "U01313A0AGP",
slackUsername: "John.Doe",
},
Expand Down
2 changes: 1 addition & 1 deletion types/advocates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ADVOCATES_WORLD_REGION_OPTIONS = Object.values(

interface Advocate {
city: string;
country: string[];
country: string;
image: string;
location?: string;
name: string;
Expand Down

0 comments on commit cbe78bd

Please sign in to comment.