add user leantime api 3

This commit is contained in:
Alma 2025-04-10 20:33:20 +02:00
parent bd12734bb8
commit 516e80905e

View File

@ -206,6 +206,7 @@ async function createLeantimeUser(userData: {
firstName: string;
lastName: string;
email: string;
password: string;
}): Promise<{ success: boolean; error?: string }> {
try {
const response = await fetch('https://agilite.slm-lab.net/api/jsonrpc', {
@ -224,6 +225,7 @@ async function createLeantimeUser(userData: {
lastname: userData.lastName,
username: userData.username,
email: userData.email,
password: userData.password,
status: 'active',
role: 'user', // Default role in Leantime
}
@ -414,6 +416,7 @@ export async function POST(req: Request) {
firstName: data.firstName,
lastName: data.lastName,
email: data.email,
password: data.password,
});
if (!leantimeResult.success) {