- creato editor di Pagine (iniziato)
- fix: mancano i "t," su alcuni componenti...
This commit is contained in:
@@ -191,6 +191,26 @@ function subDays(date, days) {
|
||||
return newDate;
|
||||
}
|
||||
|
||||
router.delete('/mypage/:id', authenticate, async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
|
||||
|
||||
|
||||
// Trova il record di MyPage da cancellare
|
||||
const pageToDelete = await MyPage.findByIdAndRemove(id);
|
||||
|
||||
if (!pageToDelete) {
|
||||
return res.status(404).json({ error: 'Pagina non trovata' });
|
||||
}
|
||||
|
||||
res.json({ message: `Pagina eliminata con successo: ${pageToDelete.path}` });
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
res.status(500).json({ error: 'Errore durante l\'eliminazione della pagina' });
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/pageviews/users', authenticate_noerror, async (req, res) => {
|
||||
try {
|
||||
const { idapp } = req.query;
|
||||
|
||||
Reference in New Issue
Block a user