working leantime widget 134
This commit is contained in:
parent
85a1bbc584
commit
ea2eecc43c
@ -98,7 +98,7 @@ export async function GET(request: NextRequest) {
|
||||
const userId = await getLeantimeUserId(session.user.email);
|
||||
|
||||
if (!userId) {
|
||||
console.error('User not found in Leantime:', session.user.email);
|
||||
console.error('User not found in Leantime');
|
||||
return NextResponse.json({ error: "User not found in Leantime" }, { status: 404 });
|
||||
}
|
||||
|
||||
@ -123,13 +123,12 @@ export async function GET(request: NextRequest) {
|
||||
});
|
||||
|
||||
const responseText = await response.text();
|
||||
console.log('Raw tasks response:', responseText);
|
||||
console.log('Tasks API response status:', response.status);
|
||||
|
||||
if (!response.ok) {
|
||||
console.error('Failed to fetch tasks from Leantime:', {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
headers: Object.fromEntries(response.headers.entries())
|
||||
statusText: response.statusText
|
||||
});
|
||||
throw new Error('Failed to fetch tasks from Leantime');
|
||||
}
|
||||
@ -138,7 +137,7 @@ export async function GET(request: NextRequest) {
|
||||
try {
|
||||
data = JSON.parse(responseText);
|
||||
} catch (e) {
|
||||
console.error('Failed to parse tasks response:', e);
|
||||
console.error('Failed to parse tasks response');
|
||||
throw new Error('Invalid response format from Leantime');
|
||||
}
|
||||
|
||||
@ -147,8 +146,9 @@ export async function GET(request: NextRequest) {
|
||||
throw new Error('Invalid response format from Leantime');
|
||||
}
|
||||
|
||||
// Log the first task to see its complete structure
|
||||
console.log('Sample task structure:', JSON.stringify(data.result[0], null, 2));
|
||||
// Log only the number of tasks and their IDs
|
||||
console.log('Received tasks count:', data.result.length);
|
||||
console.log('Task IDs:', data.result.map((task: any) => task.id));
|
||||
|
||||
const tasks = data.result
|
||||
.filter((task: any) => {
|
||||
|
||||
@ -172,6 +172,7 @@ export async function DELETE(
|
||||
}
|
||||
|
||||
const userDetails = await userResponse.json();
|
||||
console.log('Processing user deletion for ID:', params.userId);
|
||||
|
||||
// Delete user from Keycloak
|
||||
const deleteResponse = await fetch(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user