✅ add - nouvelles imges

feature/page-admin
Eric 4 years ago
parent 27187c6c68
commit ed9c87903e

@ -1,7 +1,7 @@
{ {
"workbench.colorCustomizations": { "workbench.colorCustomizations": {
"activityBar.background": "#4C1F25", "activityBar.background": "#521342",
"titleBar.activeBackground": "#6A2C34", "titleBar.activeBackground": "#731B5D",
"titleBar.activeForeground": "#FEFCFC" "titleBar.activeForeground": "#FDF8FC"
} }
} }

@ -0,0 +1,36 @@
import { NextApiRequest, NextApiResponse } from 'next';
import { getSession } from 'next-auth/react';
import { Role } from '../../../enum/role.enum';
import prisma from '../../../lib/prisma';
//api qui va rendre un utilisateur super admin (pour les developpeurs)
//--> http://localhost:3000/api/superadmin?pass=1234 (a effacer)
export default async function makeMeSuper(req: NextApiRequest, res: NextApiResponse) {
const { pass } = req.query;
const session = await getSession({ req })
const goodPassword = pass === '1234';
//si utilisateur connecté et que le parametre 'pass' est '1234'
if (session && goodPassword) {
//MAJ de l'utilisateur en superadmin
await prisma.user.update({
where: { email: session.user.email },
data: {
role: Role.SUPERADMIN,
},
})
return res.status(200).send({ message: 'Profiled updated welcome SUPERADMIN !' });
} else {
res.status(401).send({ message: 'Unauthorized' })
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 MiB

Loading…
Cancel
Save