chore(deps): Update dependencies and refactor API routes for improved error handling

- Updated various dependencies in package.json and pnpm-lock.yaml, including '@clerk/nextjs' to version 6.7.1 and several others for better performance and security.
- Refactored API routes to use Promise.resolve for context parameters, enhancing reliability in asynchronous contexts.
- Improved error handling in the dashboard and studies components, ensuring better user experience during data fetching.
- Removed unused favicon.ico file to clean up the project structure.
- Enhanced the dashboard components to utilize a new utility function for API URL fetching, promoting code reusability.
This commit is contained in:
2024-12-05 11:52:22 -05:00
parent 29ce631901
commit 207f4d7fb8
25 changed files with 719 additions and 682 deletions

View File

@@ -12,6 +12,7 @@ import Link from "next/link";
import { useActiveStudy } from "~/context/active-study";
import { hasPermission } from "~/lib/permissions-client";
import { PERMISSIONS } from "~/lib/permissions";
import { getApiUrl } from "~/lib/fetch-utils";
export default function NewParticipant() {
const [name, setName] = useState("");
@@ -36,7 +37,7 @@ export default function NewParticipant() {
setIsSubmitting(true);
try {
const response = await fetch(`/api/studies/${id}/participants`, {
const response = await fetch(getApiUrl(`/api/studies/${id}/participants`), {
method: "POST",
headers: {
"Content-Type": "application/json",