Fix scouthub-home-be

This commit is contained in:
Lorenzo Sanesi
2026-07-25 12:09:12 +02:00
parent ac92ca43ce
commit 5b7c82d359
39 changed files with 2116 additions and 81 deletions
+6 -9
View File
@@ -1,13 +1,10 @@
import { keycloakAdminHttp } from './httpClient';
import { KeycloakUserSummary } from './types';
export async function findUserByEmail(email: string): Promise<KeycloakUserSummary | null> {
// TODO: GET {adminBaseUrl}/users?email={email}&exact=true, restituire il
// primo risultato mappato a { id } oppure null se l'array è vuoto.
throw new Error('Not implemented');
}
export async function createUser(email: string, datiProfilo: object): Promise<{ userId: string }> {
// TODO: POST {adminBaseUrl}/users con { email, ...datiProfilo, enabled: true },
// leggere l'id dall'header Location della risposta.
throw new Error('Not implemented');
const response = await keycloakAdminHttp.get<Array<{ id: string }>>('/users', {
params: { email, exact: true },
});
const [utente] = response.data;
return utente ? { id: utente.id } : null;
}