Refactor DashboardCard component: add active prop handling and improve option click logic
This commit is contained in:
@@ -7,9 +7,9 @@ export const recentlyViewed = async (organization: string, userId: string) => {
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
Authorization: "Bearer <access_token>", // Replace with actual token
|
||||
Authorization: "Bearer <access_token>", // Replace with actual token
|
||||
"Content-Type": "application/json",
|
||||
token: localStorage.getItem("token") || "", // Coerce null to empty string
|
||||
token: localStorage.getItem("token") || "", // Coerce null to empty string
|
||||
refresh_token: localStorage.getItem("refreshToken") || "",
|
||||
},
|
||||
}
|
||||
@@ -18,9 +18,7 @@ export const recentlyViewed = async (organization: string, userId: string) => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch project");
|
||||
}
|
||||
|
||||
|
||||
console.log('response: ', response);
|
||||
return await response.json();
|
||||
} catch (error: any) {
|
||||
console.error("Failed to get project");
|
||||
|
||||
@@ -4,7 +4,7 @@ const url_Backend_dwinzo = `http://${process.env.REACT_APP_SERVER_REST_API_BASE_
|
||||
export const restoreTrash = async (organization: string, projectId: string) => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${url_Backend_dwinzo}api/v2/Trash/restore?projectId=${projectId}`,
|
||||
`${url_Backend_dwinzo}/api/v2/Trash/restore?projectId=${projectId}`,
|
||||
{
|
||||
method: "PATCH",
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user