Skip to content

Commit f067e09

Browse files
committed
chore(review): app crashes when joining congregation
1 parent fb8cfb0 commit f067e09

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

src/components/congregation_selector/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import useCongregation from './useCongregation';
1111
/**
1212
* Component for selecting a congregation.
1313
* @param {Object} props - Props for the CongregationSelector component.
14-
* @param {CountryType} props.country - The selected country.
1514
* @param {(value: CongregationResponseType) => void} props.setCongregation - Function to set the selected congregation.
1615
* @returns {JSX.Element} CongregationSelector component.
1716
*/

src/components/country_selector/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { CountryResponseType } from '@definition/api';
1010
/**
1111
* Component for selecting a country.
1212
* @param {CountrySelectorProps} props - Props for the CountrySelector component.
13-
* @param {(value: CountryType) => void} props.handleCountryChange - Function to handle country change.
1413
* @returns {JSX.Element} CountrySelector component.
1514
*/
1615

src/components/country_selector/useCountry.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { countriesState } from '@states/app';
1111
/**
1212
* Hook for managing country data and selection.
1313
* @param {Object} props - Props for the useCountry hook.
14-
* @param {(value: CountryType) => void} props.handleCountryChange - Function to handle country change.
1514
* @returns {Object} Object containing country data and selection state.
1615
*/
1716
const useCountry = ({

src/features/app_start/vip/request_access/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Box, Stack } from '@mui/material';
22
import { IconAccount } from '@components/icons';
3-
import IconLoading from '@components/icon_loading';
43
import { useAppTranslation } from '@hooks/index';
54
import useRequestAccess from './useRequestAccess';
65
import Button from '@components/button';
76
import CongregationSelector from '@components/congregation_selector';
87
import CountrySelector from '@components/country_selector';
8+
import IconLoading from '@components/icon_loading';
99
import TextField from '@components/textfield';
1010

1111
const RequestAccess = () => {
@@ -47,11 +47,11 @@ const RequestAccess = () => {
4747
/>
4848
</Box>
4949

50-
<CountrySelector handleCountryChange={setCountry} />
50+
<CountrySelector value={country} handleCountryChange={setCountry} />
5151

5252
{country !== null && (
5353
<CongregationSelector
54-
country_guid={country.guid}
54+
country_guid={country.countryGuid}
5555
setCongregation={setCongregation}
5656
/>
5757
)}

src/features/app_start/vip/request_access/useRequestAccess.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useState } from 'react';
22
import { useAtomValue } from 'jotai';
33
import { useAppTranslation } from '@hooks/index';
4-
import { CongregationResponseType } from '@definition/api';
5-
import { CountryType } from '@components/country_selector/index.types';
4+
import { CongregationResponseType, CountryResponseType } from '@definition/api';
65
import { firstnameState, lastnameState } from '@states/settings';
76
import { displaySnackNotification } from '@services/states/app';
87
import { getMessageByCode } from '@services/i18n/translation';
@@ -18,7 +17,7 @@ const useRequestAccess = () => {
1817
const [requestSent, setRequestSent] = useState(false);
1918
const [firstname, setFirstname] = useState(firstnameInitial);
2019
const [lastname, setLastname] = useState(lastnameInitial);
21-
const [country, setCountry] = useState<CountryType>(null);
20+
const [country, setCountry] = useState<CountryResponseType>(null);
2221
const [congregation, setCongregation] =
2322
useState<CongregationResponseType>(null);
2423

@@ -30,7 +29,7 @@ const useRequestAccess = () => {
3029

3130
await apiUserJoinCongregation({
3231
cong_name: congregation.congName,
33-
country_code: country.code,
32+
country_code: country.countryCode,
3433
firstname,
3534
lastname,
3635
});

0 commit comments

Comments
 (0)