fix(backend): setup/complete accepte userId null pour éviter erreur UUID (#14)
- completeSetup: userId = req.user?.id ?? null (plus de fallback 'system') - markSetupCompleted(userId: string | null), set(..., userId ?? undefined) - Corrige 'invalid input syntax for type uuid: "system"' au clic Sauvegarder Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6752dc97b4
commit
ae3292a7fc
@ -53,8 +53,7 @@ export class ConfigController {
|
||||
// @Roles('super_admin')
|
||||
async completeSetup(@Request() req: any) {
|
||||
try {
|
||||
// TODO: Récupérer l'ID utilisateur depuis le JWT
|
||||
const userId = req.user?.id || 'system';
|
||||
const userId = req.user?.id ?? null;
|
||||
|
||||
await this.configService.markSetupCompleted(userId);
|
||||
|
||||
|
||||
@ -259,10 +259,10 @@ export class AppConfigService implements OnModuleInit {
|
||||
|
||||
/**
|
||||
* Marquer la configuration initiale comme terminée
|
||||
* @param userId ID de l'utilisateur qui termine la configuration
|
||||
* @param userId ID de l'utilisateur qui termine la configuration (null si non authentifié)
|
||||
*/
|
||||
async markSetupCompleted(userId: string): Promise<void> {
|
||||
await this.set('setup_completed', 'true', userId);
|
||||
async markSetupCompleted(userId: string | null): Promise<void> {
|
||||
await this.set('setup_completed', 'true', userId ?? undefined);
|
||||
this.logger.log('✅ Configuration initiale marquée comme terminée');
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user