mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Optimize allData queries (#3452)
* Add specific fields to allData queries * Add additional allData endpoints
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { Form } from "react-bootstrap";
|
||||
import { defineMessages, MessageDescriptor, useIntl } from "react-intl";
|
||||
import { FilterSelect, ValidTypes } from "src/components/Shared/Select";
|
||||
import { FilterSelect, SelectObject } from "src/components/Shared/Select";
|
||||
import { Criterion } from "src/models/list-filter/criteria/criterion";
|
||||
import { IHierarchicalLabelValue } from "src/models/list-filter/types";
|
||||
|
||||
@@ -35,11 +35,11 @@ export const HierarchicalLabelValueFilter: React.FC<
|
||||
},
|
||||
});
|
||||
|
||||
function onSelectionChanged(items: ValidTypes[]) {
|
||||
function onSelectionChanged(items: SelectObject[]) {
|
||||
const { value } = criterion;
|
||||
value.items = items.map((i) => ({
|
||||
id: i.id,
|
||||
label: i.name!,
|
||||
label: i.name ?? i.title ?? "",
|
||||
}));
|
||||
onValueChanged(value);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { Form } from "react-bootstrap";
|
||||
import { FilterSelect, ValidTypes } from "src/components/Shared/Select";
|
||||
import { FilterSelect, SelectObject } from "src/components/Shared/Select";
|
||||
import { Criterion } from "src/models/list-filter/criteria/criterion";
|
||||
import { ILabeledId } from "src/models/list-filter/types";
|
||||
|
||||
@@ -26,11 +26,11 @@ export const LabeledIdFilter: React.FC<ILabeledIdFilterProps> = ({
|
||||
)
|
||||
return null;
|
||||
|
||||
function onSelectionChanged(items: ValidTypes[]) {
|
||||
function onSelectionChanged(items: SelectObject[]) {
|
||||
onValueChanged(
|
||||
items.map((i) => ({
|
||||
id: i.id,
|
||||
label: i.name!,
|
||||
label: i.name ?? i.title ?? "",
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user