remove console log

This commit is contained in:
Zhaoqi Li
2025-07-18 09:38:45 -07:00
parent 29d83feb6e
commit 418f866017
10 changed files with 10 additions and 50 deletions
-2
View File
@@ -44,8 +44,6 @@ export async function GET(
// Use the optimized query with selective loading
const organization = await organizationService.getOrganization(organizationId, true);
console.log("organization is ", organization);
if (!organization) {
return NextResponse.json(
-1
View File
@@ -102,7 +102,6 @@ export async function POST(request: Request) {
},
}
});
console.log("project is ", project);
return NextResponse.json({
success: true,
data: project
-13
View File
@@ -372,19 +372,6 @@ export default function OrganizationsPage() {
>
<Edit className="h-4 w-4" />
</Button>
<Button
variant="ghost"
size="sm"
onClick={() => handleDeleteOrganization(org)}
disabled={org._count.projects > 0 || org._count.organizationUsers > 0 || deletingOrgId === org.id}
title={org._count.projects > 0 || org._count.organizationUsers > 0 ? "Cannot delete: organization has projects or members" : "Delete organization"}
>
{deletingOrgId === org.id ? (
<Loader2 className="h-4 w-4 animate-spin" />
) : (
<Trash2 className="h-4 w-4" />
)}
</Button>
</div>
</div>
</CardHeader>
+1 -4
View File
@@ -135,7 +135,6 @@ export function FileUploader({
}
// Show the processing modal immediately
console.log("Starting upload - showing modal immediately");
updateProcessingStatus("uploading");
setProcessingProgress(0);
setShowProcessingModal(true);
@@ -166,7 +165,7 @@ export function FileUploader({
}
// Send the file to our API endpoint
console.log('Sending file to API...');
const response = await fetch('/api/llamaparse', {
method: 'POST',
body: formData,
@@ -202,7 +201,6 @@ export function FileUploader({
// When complete, move to parsing status
updateProcessingStatus("parsing");
console.log("LlamaParse processing complete, waiting for OpenAI to extract questions");
// Call the onFileProcessed callback to begin question extraction
if (onFileProcessed) {
@@ -211,7 +209,6 @@ export function FileUploader({
// Update to extracting status when OpenAI API call begins
setTimeout(() => {
updateProcessingStatus("extracting");
console.log("Starting OpenAI extraction process");
// Keep modal open until question extraction completes
// The page component will handle hiding the modal
+2 -4
View File
@@ -30,12 +30,11 @@ export function ImportingDialog({
const isAnalyzed = status === "mapping" || status === "complete";
const isComplete = status === "complete";
console.log("ImportingDialog render:", { open, fileName, status, progress });
// Force rerender to ensure dialog visibility
useEffect(() => {
if (open) {
console.log("EFFECT: Dialog should be visible now");
// Force a reflow to ensure dialog renders
document.body.style.overflow = "hidden";
return () => {
@@ -46,7 +45,6 @@ export function ImportingDialog({
// Force the dialog to be non-dismissible during processing
const handleOpenChange = (newOpen: boolean) => {
console.log("Dialog open state change requested:", newOpen);
// Only allow closing if process is complete or if explicitly trying to close
if (status === "complete" || !newOpen) {
@@ -55,7 +53,7 @@ export function ImportingDialog({
};
if (!open) {
console.log("Dialog is not open, not rendering content");
return null;
}
+2 -4
View File
@@ -13,8 +13,6 @@ interface TeamContentProps {
export function TeamContent({ orgId }: TeamContentProps) {
console.log("TeamContent debugging 1 orgId", orgId)
const [members, setMembers] = useState<TeamMember[]>([]);
const [organization, setOrganization] = useState<any>(null);
const [isLoading, setIsLoading] = useState(true);
@@ -30,7 +28,7 @@ export function TeamContent({ orgId }: TeamContentProps) {
}
if (membersData && Array.isArray(membersData)) {
console.log("API response for members:", membersData);
// Transform the data structure to match our TeamMember interface
const transformedMembers = membersData.map((orgUser: any) => ({
@@ -42,7 +40,7 @@ export function TeamContent({ orgId }: TeamContentProps) {
avatarUrl: orgUser.user?.avatarUrl
}));
console.log("Transformed members:", transformedMembers);
setMembers(transformedMembers);
}
@@ -265,8 +265,6 @@ export function ProjectIndexSelector({ projectId }: ProjectIndexSelectorProps) {
<div className="space-y-3">
{availableIndexes.map((index) => {
const isSelected = selectedIndexIds.includes(index.id);
console.log("availableIndexes",availableIndexes);
return (
<div
@@ -61,14 +61,6 @@ export function MultiStepResponseDialog({
finalResponse,
sources,
}: MultiStepResponseDialogProps) {
console.log('🎭 MultiStepResponseDialog rendered with:', {
isOpen,
isGenerating,
stepsCount: currentSteps.length,
hasFinalResponse: !!finalResponse,
sourcesCount: sources?.length || 0,
sources: sources
});
const handleAccept = () => {
if (finalResponse) {
-3
View File
@@ -23,7 +23,6 @@ export function UploadComponent({ projectId }: UploadComponentProps) {
// Handle file upload completion
const handleFileProcessed = async (result: LlamaParseResult) => {
console.log("File processed:", result);
// Add project ID to the result object for reference
const resultWithProject: LlamaParseResult = {
@@ -34,7 +33,6 @@ export function UploadComponent({ projectId }: UploadComponentProps) {
try {
// Update status to parsing when starting OpenAI processing
setProcessingStatus("parsing");
console.log("Starting OpenAI extraction process");
// Store the questions in the database
const extractResponse = await fetch('/api/extract-questions', {
@@ -59,7 +57,6 @@ export function UploadComponent({ projectId }: UploadComponentProps) {
// Get the response data
const extractedData = await extractResponse.json();
console.log("Questions extracted successfully:", extractedData);
// Mark as complete
setProcessingStatus("complete");
+5 -9
View File
@@ -63,11 +63,7 @@ export function OrganizationProvider({ children }: OrganizationProviderProps) {
try {
const response = await fetch("/api/organizations");
const data = await response.json();
console.log("from /api/organizations data", data);
if (data.success) {
console.log("data.success is true");
console.log("setting organizations", data.data);
setOrganizations(data.data);
}
} catch (error) {
@@ -148,20 +144,20 @@ export function OrganizationProvider({ children }: OrganizationProviderProps) {
const projectMatch = pathname.match(/\/projects\/([^\/]+)/);
if (projectMatch) {
const projectId = projectMatch[1];
console.log(`Initializing from URL: Found project ID ${projectId}`);
// Only fetch if we don't already have this project set
if (!currentProject || currentProject.id !== projectId) {
const project = await fetchProjectById(projectId);
console.log(`Fetched project:`, project);
if (project) {
setCurrentProject(project);
setCurrentOrganization(project.organization);
await fetchProjects(project.organization.id);
manualSelectionRef.current = true; // Mark as manually set from URL
console.log(`Set current project to:`, project.name);
} else {
console.log(`Failed to fetch project with ID: ${projectId}`);
}
}
} else {
@@ -170,7 +166,7 @@ export function OrganizationProvider({ children }: OrganizationProviderProps) {
pathname.includes('/upload') ||
pathname.includes('/documents');
if (currentProject && !isProjectRelatedPage) {
console.log(`Clearing current project because not on project-related page`);
setCurrentProject(null);
}
}