Skip to content

Commit df8ea7f

Browse files
authored
fix: adjust sponsor get function validation, initial company id (#794)
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
1 parent 8bbc259 commit df8ea7f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/pages/sponsors/sponsor-users-list-page/components/process-request-form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const buildInitialValues = (data) => {
2828

2929
normalized.name = data.requester_first_name;
3030
normalized.email = data.requester_email;
31-
normalized.company = { id: data.company_id, name: data.company_name };
31+
normalized.company = { id: data.company_id ?? 0, name: data.company_name };
3232
normalized.tiers = [];
3333
normalized.access_rights = [];
3434
normalized.send_email = true;

src/pages/sponsors/sponsor-users-list-page/components/process-request-popup.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ const ProcessRequestPopup = ({
2929
const [requestSponsor, setRequestSponsor] = useState(null);
3030
useEffect(() => {
3131
getUserGroups(1, MAX_PER_PAGE);
32-
fetchSponsorByCompany(request.company_id, currentSummit.id).then(
33-
(sponsor) => setRequestSponsor(sponsor)
34-
);
32+
if (request.company_id) {
33+
fetchSponsorByCompany(request.company_id, currentSummit.id).then(
34+
(sponsor) => setRequestSponsor(sponsor)
35+
);
36+
}
3537
}, []);
3638

3739
const handleClose = () => {

0 commit comments

Comments
 (0)