🔧 Added __str__ key to the series AsyncSelectPaginate populator
This commit is contained in:
@@ -11,7 +11,7 @@ export const fetchMetronResource = async (options) => {
|
|||||||
console.log("has more? ", !isNil(metronResourceResults.data.next));
|
console.log("has more? ", !isNil(metronResourceResults.data.next));
|
||||||
const results = metronResourceResults.data.results.map((result) => {
|
const results = metronResourceResults.data.results.map((result) => {
|
||||||
return {
|
return {
|
||||||
label: result.name,
|
label: result.name || result.__str__,
|
||||||
value: result.id,
|
value: result.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,12 +6,10 @@ import { withAsyncPaginate } from "react-select-async-paginate";
|
|||||||
const CreatableAsyncPaginate = withAsyncPaginate(Creatable);
|
const CreatableAsyncPaginate = withAsyncPaginate(Creatable);
|
||||||
|
|
||||||
export const AsyncSelectPaginate = (props): ReactElement => {
|
export const AsyncSelectPaginate = (props): ReactElement => {
|
||||||
console.log(props);
|
|
||||||
const [value, onValueChange] = useState(null);
|
const [value, onValueChange] = useState(null);
|
||||||
const [isAddingInProgress, setIsAddingInProgress] = useState(false);
|
const [isAddingInProgress, setIsAddingInProgress] = useState(false);
|
||||||
|
|
||||||
const mudasir = useCallback((query, loadedOptions, { page }) => {
|
const mudasir = useCallback((query, loadedOptions, { page }) => {
|
||||||
console.log(page);
|
|
||||||
return fetchMetronResource({
|
return fetchMetronResource({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
resource: props.metronResource,
|
resource: props.metronResource,
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ export const EditMetadataPanel = (props): ReactElement => {
|
|||||||
};
|
};
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
const [seriesValue, onSeriesValueChange] = useState(null);
|
|
||||||
const [creatorValue, onCreatorValueChange] = useState(null);
|
|
||||||
const [isAddingInProgress, setIsAddingInProgress] = useState(false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Form
|
<Form
|
||||||
|
|||||||
Reference in New Issue
Block a user