fix(frontend): persist search param nlpValue

This commit is contained in:
yassinedorbozgithub 2025-05-26 17:23:50 +01:00
parent 92be4a3e3b
commit 8ed5188d0d

View File

@ -51,9 +51,10 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
entity: EntityType.NLP_ENTITY, entity: EntityType.NLP_ENTITY,
format: Format.FULL, format: Format.FULL,
}); });
const { onSearch, searchPayload } = useSearch<INlpValue>({ const { ref, onSearch, searchPayload } = useSearch<INlpValue>({
$eq: [{ entity: entityId }], $eq: [{ entity: entityId }],
$or: ["doc", "value"], $or: ["doc", "value"],
queryParam: { key: "search", defaultValue: "" },
}); });
const { dataGridProps } = useFind( const { dataGridProps } = useFind(
{ entity: EntityType.NLP_VALUE, format: Format.FULL }, { entity: EntityType.NLP_VALUE, format: Format.FULL },
@ -228,7 +229,7 @@ export const NlpValues = ({ entityId }: { entityId: string }) => {
sx={{ width: "max-content", gap: 1 }} sx={{ width: "max-content", gap: 1 }}
> >
<Grid item> <Grid item>
<FilterTextfield onChange={onSearch} /> <FilterTextfield inputRef={ref} onChange={onSearch} />
</Grid> </Grid>
<ButtonGroup sx={{ marginLeft: "auto" }}> <ButtonGroup sx={{ marginLeft: "auto" }}>
{hasPermission( {hasPermission(