fix: encode url for percent encoding

This commit is contained in:
monoid 2023-07-24 11:21:26 +09:00
parent 9c88d4c246
commit d9ab67cd19
2 changed files with 3 additions and 2 deletions

View File

@ -94,6 +94,7 @@ name: string}){
const parent = useRef<HTMLDivElement>(null);
useEffect(()=>{
(async ()=>{
console.log("animation mount on ",name);
const {default:autoAnimate} = await import("https://esm.sh/@formkit/auto-animate@0.7.0");
parent.current && autoAnimate(parent.current)
})();
@ -170,7 +171,7 @@ function filterInfo(info: Coperation[], filterList: FilterInfoOption) {
export default function StockListUI(props: StockProps) {
const sig = useAsync<[PageCorpsInfo, CorpSimple[], CorpSimple[]]>(async () => {
const res = await Promise.all([
fetch("/api/pages/" + props.pageName),
fetch("/api/pages/" + encodeURIComponent(props.pageName)),
fetch("/api/kospi"),
fetch("/api/kosdaq"),
]);

View File

@ -33,7 +33,7 @@ export default function Home({data}: PageProps<PageDescription[]>) {
<ul>
{
data.map(x=><li class="my-2">
<a class="p-2 block hover:bg-gray-300 bg-white rounded" href={`/pages/${x.name}`}>
<a class="p-2 block hover:bg-gray-300 bg-white rounded" href={`/pages/${encodeURIComponent(x.name)}`}>
{x.name}
</a>
</li>