Skip to content

Commit

Permalink
remove toast from the server side functions
Browse files Browse the repository at this point in the history
  • Loading branch information
karamba228 committed Feb 7, 2025
1 parent 9156f6a commit 6921b57
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/utils/search_conda.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { toast } from "react-toastify";

export type CondaApiPackage = {
name: string;
latestVersion: string;
Expand All @@ -19,6 +17,7 @@ async function fetchCondaPackages(query: string): Promise<CondaApiPackage[]> {

return await response.json();
} catch (error) {
console.log(error);
throw error;
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/utils/search_npm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { toast } from "react-toastify";

export type NpmPackageResult = {
name: string;
version: string;
Expand All @@ -21,8 +19,7 @@ export default async function searchNpmPackages(

return await response.json();
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : "An unknown error occurred.";
console.log(error);
throw error;
}
}
5 changes: 1 addition & 4 deletions src/utils/search_pypi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { toast } from "react-toastify";
import { stringSimilarity } from "string-similarity-js";

export type PyPIPackageResult = {
Expand All @@ -20,9 +19,7 @@ async function fetchPyPIProjects(): Promise<PyPIPackageResult[]> {
const data = await response.json();
return data.projects ?? [];
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : "An unknown error occurred.";
toast.error(`Failed to fetch PyPI packages: ${errorMessage}`);
console.log(error);
throw error;
}
}
Expand Down

0 comments on commit 6921b57

Please sign in to comment.