Add management capability for system backups to the platform

Implement and expose new API endpoints for managing backups including listing, downloading, and deleting, enhancing the existing backup system.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/2HHgup2
This commit is contained in:
michaelschal committed 2025-08-13 21:10:58 +00:00
1 parent d68043c336
commit 0a565ea490
3 files changed
+6 -6

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
// Système de permissions hardcodé par module
// Remplace l'ancien système flexible basé sur la base de données
export type Permission = 'view' | 'create' | 'edit' | 'delete' | 'validate';
export type Permission = 'view' | 'create' | 'edit' | 'delete' | 'validate' | 'manage';
export type Role = 'admin' | 'directeur' | 'manager' | 'employee';
export type Module =
| 'dashboard'
+1 -1
View File
@@ -264,7 +264,7 @@ export default function BackupManager() {
</div>
) : (
<div className="space-y-2">
{backups.map((backup) => (
{backups.map((backup: BackupFile) => (
<div
key={backup.id}
className="flex items-center justify-between p-4 border rounded-lg hover:bg-gray-50"
+4 -4
View File
@@ -2340,7 +2340,7 @@ RÉSUMÉ DU SCAN
});
// Backup management routes (Admin only)
app.get('/api/backups', isAuthenticated, requireAdmin, async (req: any, res) => {
app.get('/api/backups', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const backups = await backupService.getBackupList();
res.json(backups);
@@ -2350,7 +2350,7 @@ RÉSUMÉ DU SCAN
}
});
app.post('/api/backups', isAuthenticated, requireAdmin, async (req: any, res) => {
app.post('/api/backups', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const user = await storage.getUserWithGroups(req.user.claims ? req.user.claims.sub : req.user.id);
if (!user) {
@@ -2365,7 +2365,7 @@ RÉSUMÉ DU SCAN
}
});
app.get('/api/backups/:filename/download', isAuthenticated, requireAdmin, async (req: any, res) => {
app.get('/api/backups/:filename/download', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const { filename } = req.params;
const filepath = await backupService.downloadBackup(filename);
@@ -2382,7 +2382,7 @@ RÉSUMÉ DU SCAN
}
});
app.delete('/api/backups/:filename', isAuthenticated, requireAdmin, async (req: any, res) => {
app.delete('/api/backups/:filename', isAuthenticated, requireAdmin, async (req: any, res: any) => {
try {
const { filename } = req.params;
await backupService.deleteBackup(filename);