From f648bb5260869bd413622c7ea57ce7c4970338a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Castillo?= Date: Fri, 12 Dec 2025 15:57:26 -0300 Subject: [PATCH] fix: remove sponsor without companies from input ddl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Castillo --- src/components/inputs/sponsor-input.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/inputs/sponsor-input.js b/src/components/inputs/sponsor-input.js index ddcf4c5..f745461 100644 --- a/src/components/inputs/sponsor-input.js +++ b/src/components/inputs/sponsor-input.js @@ -13,24 +13,31 @@ import React from 'react'; import AsyncSelect from 'react-select/lib/Async'; -import {querySponsors} from '../../utils/query-actions'; +import { querySponsors } from '../../utils/query-actions'; -const SponsorInput = ({id, summitId, value, error, multi, onChange, queryFunction, ...rest}) => { +const SponsorInput = ({ id, summitId, value, error, multi, onChange, queryFunction, ...rest }) => { const queryFn = queryFunction || querySponsors; - const has_error = error !== '' ; + const has_error = error !== ''; const handleChange = (value) => { - let ev = {target: { - id: id, - value: value, - type: 'sponsorinput' - }}; + let ev = { + target: { + id: id, + value: value, + type: 'sponsorinput' + } + }; onChange(ev); } const getSponsors = (input, callback) => { - queryFn(summitId, input, callback); + const filterSponsors = (options) => { + let newOptions = options.filter(c => c.company); + callback(newOptions); + }; + + queryFn(summitId, input, filterSponsors); } return (