From e9fa0857e5d59f6de716485dffd8b789f340e041 Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Tue, 16 Apr 2024 10:27:26 -0400 Subject: [PATCH] send 200 response on successful insert --- src/Handler/Admin.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index c992e04..95b6448 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -167,7 +167,9 @@ postCheckPkgAuthR pkgId = do then sendResponseText status200 "User authorized to upload this package." else if authorized && newPkg -- if pkg is whitelisted and a new upload, add as authorized for this admin user - then runDB $ insert_ (AdminPkgs (AdminKey name) (PkgRecordKey pkgId)) + then do + runDB $ insert_ (AdminPkgs (AdminKey name) (PkgRecordKey pkgId)) + sendResponseText status200 "User authorized to upload this package." else sendResponseText status401 "User not authorized to upload this package." else sendResponseText status500 "Package does not belong on this registry."