Fixed filterByUser

This commit is contained in:
Lucas Oliveira 2023-11-16 12:03:15 -03:00
commit 9c78d0afd9
3 changed files with 5 additions and 8 deletions

View file

@ -599,7 +599,7 @@ export async function getStoreComponents(
liked?: boolean | null, liked?: boolean | null,
status?: string | null, status?: string | null,
search?: string | null, search?: string | null,
filterByUser?: string | null filterByUser?: boolean | null
): Promise<StoreComponentResponse | undefined> { ): Promise<StoreComponentResponse | undefined> {
try { try {
let url = `${BASE_URL_API}store/components/`; let url = `${BASE_URL_API}store/components/`;

View file

@ -27,7 +27,7 @@ export default function StoreApiKeyModal({
const { storeApiKey } = useContext(AuthContext); const { storeApiKey } = useContext(AuthContext);
const { hasApiKey } = useContext(StoreContext); const { hasApiKey } = useContext(StoreContext);
const [apiKeyValue, setApiKeyValue] = useState( const [apiKeyValue, setApiKeyValue] = useState(
hasApiKey ? "this is not a real api key :)" : "" hasApiKey ? "This is not a real api key." : ""
); );
function handleInput({ function handleInput({
@ -44,10 +44,6 @@ export default function StoreApiKeyModal({
} }
}, [open]); }, [open]);
function resetForm() {
setApiKeyValue("");
}
const handleSaveKey = () => { const handleSaveKey = () => {
if (inputState && inputState["apikey"]) { if (inputState && inputState["apikey"]) {
addApiKeyStore(inputState["apikey"]).then( addApiKeyStore(inputState["apikey"]).then(
@ -55,7 +51,7 @@ export default function StoreApiKeyModal({
setSuccessData({ setSuccessData({
title: "Success! Your API Key has been saved.", title: "Success! Your API Key has been saved.",
}); });
storeApiKey("9bxW74lS1qee3UWKMx3Vydxu5wxPqC8W"); storeApiKey(inputState["apikey"]);
setOpen(false); setOpen(false);
}, },
(error) => { (error) => {

View file

@ -72,7 +72,8 @@ export default function StorePage(): JSX.Element {
filteredCategories, filteredCategories,
selectFilter === "likedbyme" ? true : null, selectFilter === "likedbyme" ? true : null,
null, null,
searchText === "" ? null : searchText searchText === "" ? null : searchText,
selectFilter === "createdbyme" ? true : null
) )
.then((res) => { .then((res) => {
setLoading(false); setLoading(false);