Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@

try {
// Vérifiez et décodez le token
const decoded: any = verify(token, jwtSecret);

Check warning on line 216 in backend/src/controllers/auth.controller.ts

View workflow job for this annotation

GitHub Actions / lint-api

Unexpected any. Specify a different type

// Trouvez l'utilisateur par ID
const user = await user_service.getUserById(decoded.userId);
Expand Down Expand Up @@ -250,7 +250,7 @@

Ok(res, {
msg:
'Token renouvelé, vous pouvez renvoyer un email de bienvenu avec ce lien : https://integration.utt.fr/Register?token=' +
"Vous pouvez transmettre à l'utilisateur ce lien : https://integration.utt.fr/register?token=" +
newToken,
});
} catch (err) {
Expand Down
12 changes: 12 additions & 0 deletions backend/src/controllers/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@ export const getCurrentUserOnboardingStatus: AppRequestHandler = async (req, res
}
};

export const getAdminUserOnboardingStatus: AppRequestHandler<unknown, unknown, UserIdParams> = async (req, res) => {
const { userId } = req.params;

try {
const status = await user_service.getCurrentUserOnboardingStatus(parseInt(userId));
const hasRegToken = await user_service.hasRegistrationToken(parseInt(userId));
Ok(res, { data: { ...status, hasRegistrationToken: hasRegToken } });
} catch {
Error(res, { msg: "Erreur lors de la récupération du statut d'onboarding." });
}
};

export const getVssQuestionnaire: AppRequestHandler = async (req, res) => {
try {
const questionnaire = await user_service.getVssQuestionnaire();
Expand Down
24 changes: 14 additions & 10 deletions backend/src/database/initdb/initevent.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { eventSchema } from "../../schemas/Basic/event.schema";
import { db } from "../db"; // Assurez-vous que votre instance db est correcte
import { eventSchema } from '../../schemas/Basic/event.schema';
import { db } from '../db'; // Assurez-vous que votre instance db est correcte

export const initEvent = async () => {
const existingEvent = await db.select().from(eventSchema).limit(1);

// Si il n'y a pas de ligne existante, insérer une nouvelle ligne
if (existingEvent.length === 0) {
await db.insert(eventSchema).values({
pre_registration_open: false,
shotgun_open: false,
sdi_open: false,
wei_open: false,
food_open: false,
chall_open: false
}).onConflictDoNothing();
await db
.insert(eventSchema)
.values({
pre_registration_open: false,
shotgun_open: false,
sdi_open: false,
wei_open: false,
food_open: false,
chall_open: false,
maker_battle_group_open: false,
})
.onConflictDoNothing();
}
};
1 change: 1 addition & 0 deletions backend/src/database/migrations/0029_right_callisto.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "events" ADD COLUMN "maker_battle_group_open" boolean DEFAULT false;
Loading
Loading