From cd6f516780c1e995a850d0653de5262af3cb7354 Mon Sep 17 00:00:00 2001 From: Opaque02 <66582645+Opaque02@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:30:52 +1000 Subject: [PATCH] Updated some commentted out code --- api/endpoints.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/endpoints.go b/api/endpoints.go index 63e5ebd..d4cab3b 100644 --- a/api/endpoints.go +++ b/api/endpoints.go @@ -802,7 +802,7 @@ func handleAdminSearch(w http.ResponseWriter, r *http.Request) { log.Printf("USERNAME SEARCH STARTING") - /* + // this way does a single call that does a query for multiple columns from our database and makes an object out of it, which is returned to us /adminSearchResult, err := db.FetchAdminDetailsByUsername(username) if err != nil { @@ -811,12 +811,12 @@ func handleAdminSearch(w http.ResponseWriter, r *http.Request) { } log.Printf("Username is: %s", adminSearchResult.Username.String) writeJSON(w, r, adminSearchResult) - */ + // this way does multiple calls to get individual things (for example, a single call for username, a single call for discord Id, a single call for google Id etc) // once we have all the single fields we need, it then makes an object out of them with the info that we want - + /* dbUsername, err := db.CheckUsernameExists(username) if err != nil { httpError(w, r, err, http.StatusInternalServerError) @@ -853,6 +853,6 @@ func handleAdminSearch(w http.ResponseWriter, r *http.Request) { } writeJSON(w, r, adminResponse) - + */ log.Printf("%s: %s searched for username %s", userDiscordId, r.URL.Path, username) }