mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-10 07:18:47 +00:00
allow weather apis to use hidden api keys
This commit is contained in:
parent
08afa0b747
commit
5a8defb478
6 changed files with 61 additions and 12 deletions
|
@ -4,9 +4,8 @@ import { BiError } from "react-icons/bi";
|
|||
import Icon from "./icon";
|
||||
|
||||
export default function WeatherApi({ options }) {
|
||||
const { data, error } = useSWR(
|
||||
`/api/widgets/weather?lat=${options.latitude}&lon=${options.longitude}&apiKey=${options.apiKey}&duration=${options.cache}`
|
||||
);
|
||||
console.log(options);
|
||||
const { data, error } = useSWR(`/api/widgets/weather?${new URLSearchParams(options).toString()}`);
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue