delete user leantime api 6

This commit is contained in:
Alma 2025-04-10 21:14:24 +02:00
parent f4820017a6
commit 7abcc16cdb

View File

@ -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: {