Strange
Strange
Explore posts from servers
RRefine
Created by harsh-harlequin on 1/12/2025 in #ask-any-question
Pulling data from supabase, using <Controller /> with a column that's an array?
@kapa.ai useFieldArray() is not a hook that exists. you hallucinated it.
11 replies
RRefine
Created by ambitious-aqua on 1/12/2025 in #ask-any-question
Pulling data from supabase, using <Controller /> with a column that's an array?
okay well. that tells me what work needs to be done
11 replies
RRefine
Created by solid-orange on 1/12/2025 in #ask-any-question
Pulling data from supabase, using <Controller /> with a column that's an array?
No description
11 replies
RRefine
Created by magic-amber on 1/12/2025 in #ask-any-question
Controller autocomplete is not displaying defaultValue, but dropdown options are still correct
another:
<Controller
control={control}
name={"exam_studying_for"}
rules={{ required: "This field is required" }}
// eslint-disable-next-line
defaultValue={profileData?.exam_studying_for.id}
render={({ field }) => (
<Autocomplete
{...examAutocompleteProps}
{...field}
onChange={(_, value) => {
field.onChange(value.id);
}}
getOptionLabel={(item) => {
const found = examAutocompleteProps?.options?.find((p) => {
const itemId =
typeof item === "object"
? item?.id?.toString()
: item?.toString();
const pId = p?.id?.toString();
return itemId === pId;
})
return `${found?.exam_name} - ${found?.exam_description}`;
}}
isOptionEqualToValue={(option, value) => {
const optionId = option?.id?.toString();
const valueId =
typeof value === "object"
? value?.id?.toString()
: value?.toString();
return value === undefined || optionId === valueId;
}}
renderInput={(params) => (
<TextField
{...params}
label={"Exam Studying For:"}
margin="normal"
variant="outlined"
error={!!(errors as any)?.exam_studying_for?.id}
helperText={(errors as any)?.exam_studying_for?.id?.message}
required
/>
)}
/>
)}
/>
<Controller
control={control}
name={"exam_studying_for"}
rules={{ required: "This field is required" }}
// eslint-disable-next-line
defaultValue={profileData?.exam_studying_for.id}
render={({ field }) => (
<Autocomplete
{...examAutocompleteProps}
{...field}
onChange={(_, value) => {
field.onChange(value.id);
}}
getOptionLabel={(item) => {
const found = examAutocompleteProps?.options?.find((p) => {
const itemId =
typeof item === "object"
? item?.id?.toString()
: item?.toString();
const pId = p?.id?.toString();
return itemId === pId;
})
return `${found?.exam_name} - ${found?.exam_description}`;
}}
isOptionEqualToValue={(option, value) => {
const optionId = option?.id?.toString();
const valueId =
typeof value === "object"
? value?.id?.toString()
: value?.toString();
return value === undefined || optionId === valueId;
}}
renderInput={(params) => (
<TextField
{...params}
label={"Exam Studying For:"}
margin="normal"
variant="outlined"
error={!!(errors as any)?.exam_studying_for?.id}
helperText={(errors as any)?.exam_studying_for?.id?.message}
required
/>
)}
/>
)}
/>
Pressing the "Save" button on this edit page gives me an error:
Invalid input syntax for type bigint: "{"id":1,"exam_name":"SAT"}"
Error when updating profile (status code: 22)
Invalid input syntax for type bigint: "{"id":1,"exam_name":"SAT"}"
Error when updating profile (status code: 22)
@kapa.ai
20 replies
RRefine
Created by genetic-orange on 1/12/2025 in #ask-any-question
Controller autocomplete is not displaying defaultValue, but dropdown options are still correct
@kapa.ai
20 replies
RRefine
Created by funny-blue on 1/12/2025 in #ask-any-question
Controller autocomplete is not displaying defaultValue, but dropdown options are still correct
oops
20 replies
RRefine
Created by rising-crimson on 1/12/2025 in #ask-any-question
Controller autocomplete is not displaying defaultValue, but dropdown options are still correct
@kapa.ai
20 replies
RRefine
Created by flat-fuchsia on 1/12/2025 in #ask-any-question
Controller autocomplete is not displaying defaultValue, but dropdown options are still correct
wow
20 replies
RRefine
Created by correct-apricot on 1/11/2025 in #ask-any-question
Weird POST request to a raffle API endpoint?
this is a devtools thing?
5 replies