add user leantime api 2

This commit is contained in:
Alma 2025-04-10 20:30:07 +02:00
parent dc0021dc91
commit bd12734bb8

View File

@ -212,7 +212,7 @@ async function createLeantimeUser(userData: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.LEANTIME_TOKEN}`,
'X-API-Key': process.env.LEANTIME_TOKEN || '',
},
body: JSON.stringify({
method: 'leantime.rpc.Users.Users.addUser',
@ -232,12 +232,13 @@ async function createLeantimeUser(userData: {
});
const data = await response.json();
console.log('Leantime response:', data);
if (!response.ok || !data.result) {
console.error('Leantime user creation failed:', data);
return {
success: false,
error: 'Failed to create user in Leantime'
error: data.error?.message || 'Failed to create user in Leantime'
};
}