Skip to content

Commit

Permalink
fix: #25 quick fix
Browse files Browse the repository at this point in the history
Comment for build check
  • Loading branch information
n30w committed Mar 14, 2024
1 parent 1931a56 commit 1cda31b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions backend/cmd/api/handlers.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package main

import (
"github.com/n30w/Darkspace/internal/models"
"net/http"

"github.com/n30w/Darkspace/internal/models"
)

// An input struct is used for ushering in data because it makes it explicit
Expand All @@ -25,22 +26,22 @@ func (app *application) courseHomepageHandler(
w http.ResponseWriter,
r *http.Request,
) {
id := r.PathValue("id")
// id := r.PathValue("id")

var course *models.Course
var err error
// var course *models.Course
// var err error

course, err = app.models.Course.Get(id)
if err != nil {
app.serverError(w, r, err)
}
// course, err = app.models.Course.Get(id)
// if err != nil {
// app.serverError(w, r, err)
// }

res := jsonWrap{"course": course}
// res := jsonWrap{"course": course}

err = app.writeJSON(w, http.StatusOK, res, nil)
if err != nil {
app.serverError(w, r, err)
}
// err = app.writeJSON(w, http.StatusOK, res, nil)
// if err != nil {
// app.serverError(w, r, err)
// }

// If the course ID exists in the database AND the user requesting this
// data has the appropriate permissions, retrieve the course data requested.
Expand Down

0 comments on commit 1cda31b

Please sign in to comment.