mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Enable administrators to delete sales and manage store selections
Fixes sales deletion route and updates admin user role in the database. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 4b008663-bd72-492b-b0b6-fa252367e730 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/4b008663-bd72-492b-b0b6-fa252367e730/gfGF2TH
This commit is contained in:
1 parent
be78e1497c
commit
fd2ef4f7a1
4 files changed
+54
-2
No files matched your search
+1
-1
@@ -340,7 +340,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
}
|
||||
});
|
||||
|
||||
app.delete('/api/sales/:id', requireRole(['admin', 'manager']), async (req, res) => {
|
||||
app.delete('/api/sales/:id', requireRole(['administrator', 'manager']), async (req, res) => {
|
||||
try {
|
||||
const saleId = parseInt(req.params.id);
|
||||
await storage.deleteSale(saleId);
|
||||
|
||||
Reference in new issue
Block a user