fix(search): Handle search errors and escape * (#893)

pull/891/head
Jakob Ankarhem 4 years ago committed by GitHub
parent 7e906e2d46
commit 034968e437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,6 +11,7 @@ import { LanguageContext } from '../../context/LanguageContext';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header';
import PageTitle from '../Common/PageTitle';
import Error from '../../pages/_error';
const messages = defineMessages({
search: 'Search',
@ -53,7 +54,7 @@ const Search: React.FC = () => {
};
if (error) {
return <div>{error}</div>;
return <Error statusCode={error.code} />;
}
const titles = data?.reduce(

@ -11,6 +11,7 @@ const extraEncodes: [RegExp, string][] = [
[/\(/g, '%28'],
[/\)/g, '%29'],
[/!/g, '%21'],
[/\*/g, '%2A'],
];
const encodeURIExtraParams = (string: string): string => {

Loading…
Cancel
Save