Multiple features. Admin page with verweeste items. Breadcrump working.
This commit is contained in:
+18
@@ -394,6 +394,20 @@ CSS
|
||||
(upload-file-response attachment)
|
||||
(json-error 404 "File not found")))))
|
||||
|
||||
(define (admin-orphaned-uploads-handler config req)
|
||||
(require-role
|
||||
config req 'admin
|
||||
(λ (_session)
|
||||
(json-response (hash 'uploads (list-orphaned-uploads config))))))
|
||||
|
||||
(define (admin-delete-orphaned-upload-handler config req id)
|
||||
(require-write-role
|
||||
config req 'admin
|
||||
(λ (_session)
|
||||
(with-handlers ((exn:fail? (λ (e) (json-error 400 (exn-message e)))))
|
||||
(delete-orphaned-upload! config id)
|
||||
(json-response (hash 'ok #t))))))
|
||||
|
||||
(define (admin-users-handler config req)
|
||||
(require-role
|
||||
config req 'admin
|
||||
@@ -537,6 +551,10 @@ CSS
|
||||
(λ (req slug) (upload-handler config req slug))]
|
||||
[("uploads" (string-arg) (string-arg)) #:method "get"
|
||||
(λ (req slug stored-name) (upload-get-handler config req slug stored-name))]
|
||||
[("api" "admin" "uploads" "orphaned") #:method "get"
|
||||
(λ (req) (admin-orphaned-uploads-handler config req))]
|
||||
[("api" "admin" "uploads" "orphaned" (integer-arg)) #:method "delete"
|
||||
(λ (req id) (admin-delete-orphaned-upload-handler config req id))]
|
||||
[("api" "admin" "users") #:method "get"
|
||||
(λ (req) (admin-users-handler config req))]
|
||||
[("api" "admin" "users") #:method "post"
|
||||
|
||||
Reference in New Issue
Block a user