Skip to content

Commit

Permalink
fix: lottery rebase issues (#4162)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyjablonski authored Jun 27, 2024
1 parent 0b8fca2 commit 1f0a74e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sites/partners/src/components/shared/NavigationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const NavigationHeader = ({
},
]

if (process.env.showLottery && tabs?.lotteryLabel) {
if (process.env.showLottery === "TRUE" && tabs?.lotteryLabel) {
elements.push({
label: tabs.lotteryLabel,
path: `/listings/${listingId}/lottery`,
Expand Down
6 changes: 6 additions & 0 deletions sites/partners/src/pages/listings/[id]/applications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ApplicationOrderByKeys,
ListingsStatusEnum,
OrderByEnum,
ReviewOrderTypeEnum,
} from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import {
useSingleListingData,
Expand Down Expand Up @@ -122,6 +123,11 @@ const ApplicationsList = () => {
flagsQty: flaggedApps?.meta?.totalFlagged,
listingLabel: t("t.listingSingle"),
applicationsLabel: t("nav.applications"),
lotteryLabel:
listingDto?.status === ListingsStatusEnum.closed &&
listingDto?.reviewOrderType === ReviewOrderTypeEnum.lottery
? t("listings.lotteryTitle")
: undefined,
}}
breadcrumbs={
<Breadcrumbs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ const ApplicationsList = () => {
listingLabel: t("t.listingSingle"),
applicationsLabel: t("nav.applications"),
lotteryLabel:
listingDto.status === ListingsStatusEnum.closed &&
listingDto.reviewOrderType === ReviewOrderTypeEnum.lottery
listingDto?.status === ListingsStatusEnum.closed &&
listingDto?.reviewOrderType === ReviewOrderTypeEnum.lottery
? t("listings.lotteryTitle")
: undefined,
}}
Expand Down
11 changes: 9 additions & 2 deletions sites/partners/src/pages/listings/[id]/lottery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,18 @@ const Lottery = (props: { listing: Listing }) => {
)
}

export async function getServerSideProps(context: { params: Record<string, string> }) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getServerSideProps(context: { params: Record<string, string>; req: any }) {
let response

try {
response = await axios.get(`${process.env.backendApiBase}/listings/${context.params.id}`)
response = await axios.get(`${process.env.backendApiBase}/listings/${context.params.id}`, {
headers: {
passkey: process.env.API_PASS_KEY,
"x-forwarded-for":
context.req.headers["x-forwarded-for"] ?? context.req.socket.remoteAddress,
},
})
} catch (e) {
console.log("e = ", e)
return { notFound: true }
Expand Down
2 changes: 1 addition & 1 deletion sites/public/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"qs": "^6.10.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-google-recaptcha-v3": "^1.9.8",
"react-google-recaptcha-v3": "^1.10.1",
"react-hook-form": "^6.15.5",
"swr": "^2.1.5",
"tailwindcss": "2.2.10",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16813,7 +16813,7 @@ react-focus-lock@^2.9.4:
use-callback-ref "^1.3.0"
use-sidecar "^1.1.2"

react-google-recaptcha-v3@^1.9.8:
react-google-recaptcha-v3@^1.10.1:
version "1.10.1"
resolved "https://registry.yarnpkg.com/react-google-recaptcha-v3/-/react-google-recaptcha-v3-1.10.1.tgz#5b125bc0dec123206431860e8800e188fc735aff"
integrity sha512-K3AYzSE0SasTn+XvV2tq+6YaxM+zQypk9rbCgG4OVUt7Rh4ze9basIKefoBz9sC0CNslJj9N1uwTTgRMJQbQJQ==
Expand Down

0 comments on commit 1f0a74e

Please sign in to comment.