delete user leantime api 6
This commit is contained in:
parent
f4820017a6
commit
7abcc16cdb
@ -5,7 +5,7 @@ import { NextResponse } from "next/server";
|
|||||||
// Helper function to delete user from Leantime
|
// Helper function to delete user from Leantime
|
||||||
async function deleteLeantimeUser(username: string): Promise<{ success: boolean; error?: string }> {
|
async function deleteLeantimeUser(username: string): Promise<{ success: boolean; error?: string }> {
|
||||||
try {
|
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', {
|
const getUserResponse = await fetch('https://agilite.slm-lab.net/api/jsonrpc', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@ -13,7 +13,7 @@ async function deleteLeantimeUser(username: string): Promise<{ success: boolean;
|
|||||||
'X-API-Key': process.env.LEANTIME_TOKEN || '',
|
'X-API-Key': process.env.LEANTIME_TOKEN || '',
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
method: 'leantime.rpc.Users.Users.getUserByUsername',
|
method: 'leantime.rpc.Users.Users.getUser',
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id: 1,
|
id: 1,
|
||||||
params: {
|
params: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user