From 7abcc16cdbcd2eecf2dbcce668993d3bb0341a29 Mon Sep 17 00:00:00 2001 From: Alma Date: Thu, 10 Apr 2025 21:14:24 +0200 Subject: [PATCH] delete user leantime api 6 --- app/api/users/[userId]/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/users/[userId]/route.ts b/app/api/users/[userId]/route.ts index 2606b348..9aca4e20 100644 --- a/app/api/users/[userId]/route.ts +++ b/app/api/users/[userId]/route.ts @@ -5,7 +5,7 @@ import { NextResponse } from "next/server"; // Helper function to delete user from Leantime async function deleteLeantimeUser(username: string): Promise<{ success: boolean; error?: string }> { try { - // First, get the Leantime user ID by username + // First, get the Leantime user by username const getUserResponse = await fetch('https://agilite.slm-lab.net/api/jsonrpc', { method: 'POST', headers: { @@ -13,7 +13,7 @@ async function deleteLeantimeUser(username: string): Promise<{ success: boolean; 'X-API-Key': process.env.LEANTIME_TOKEN || '', }, body: JSON.stringify({ - method: 'leantime.rpc.Users.Users.getUserByUsername', + method: 'leantime.rpc.Users.Users.getUser', jsonrpc: '2.0', id: 1, params: {