lerchmo
lerchmo
Explore posts from servers
RRefine
Created by wise-white on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
this solved it, select: (data) => { data.data.included = data.data.included.map((i: any) => typeof i === "object" ? i.id.toString() : i ); data.data.excluded = data.data.excluded.map((i: any) => typeof i === "object" ? i.id.toString() : i );
22 replies
RRefine
Created by rare-sapphire on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
is there a way to modify the shape of the dataProvider data before it gets to the edit component?
22 replies
RRefine
Created by inland-turquoise on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
hacky to say the least
22 replies
RRefine
Created by ambitious-aqua on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
const AudiencePick: React.FC<AudiencePickProps> = (props: AudiencePickProps) => { const { value, filterDataOnExactSearchMatch, onChange, data, ...rest } = props; //@ts-ignore const strData = data?.map((item) => ({ label: item.label, value: item.value + "" })); //@ts-ignore const strValue = value?.map((item) => { //@ts-ignore if (typeof item === "object") { //@ts-ignore return item.id + ""; } else { return item; } }); const newOnChange = (newVal: string[]) => { if (onChange) { console.log(newVal); onChange(newVal); } }; return <MultiSelect {...rest} data={strData} onChange={newOnChange} value={strValue} />; }; export default AudiencePick;
22 replies
RRefine
Created by fascinating-indigo on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
const fixedFinish = () => { return onFinish({ //@ts-ignore included: included.map((i) => ({ id: i })), //@ts-ignore excluded: excluded.map((i) => ({ id: i })), ...rest, }); };
22 replies
RRefine
Created by absent-sapphire on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
This is how I am fixing it now:
22 replies
RRefine
Created by eastern-cyan on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
specifically I added the catetories multiselect, and it is empty on load
22 replies
RRefine
Created by exotic-emerald on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
it is returning [{id:1, id:2}]
22 replies
RRefine
Created by inc-lavender on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
But Strapi does not return relations like [1,2]
22 replies
RRefine
Created by other-emerald on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
22 replies
RRefine
Created by adverse-sapphire on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
Still not working correctly though
22 replies
RRefine
Created by genetic-orange on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
instead of {id:1, id:2}
22 replies
RRefine
Created by robust-apricot on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
your Fake API endpoint actually returns [1,2]
22 replies
RRefine
Created by ratty-blush on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
This is super Janky, and is not a 1:1 comparison
22 replies
RRefine
Created by deep-jade on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
22 replies
RRefine
Created by secure-lavender on 12/17/2022 in #ask-any-question
Trying to use Mantine MultiSelect With One 2 Many Field
So I am using default value, the issue is on initial render the multi select is empty .
22 replies