summaryrefslogtreecommitdiffstats
path: root/cmd/web/handlers.go
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-02-10 12:42:09 +0000
committerMatthew Lemon <y@yulqen.org>2024-02-10 12:42:09 +0000
commit030806353ca9b329bfb0102ebc10518b641511ee (patch)
tree013c4f13c8b6609196c9a315250b8e8bc0b7d746 /cmd/web/handlers.go
parentaa9b88ae875bfa82500e4702583cc40010825e71 (diff)
Adds the view handler for our organisation model
We omitted to include this earlier and it is needed for the create handler, which creates the new entity in the database and then redirects to the view handler which will show the organisation page.
Diffstat (limited to '')
-rw-r--r--cmd/web/handlers.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go
index bfe73dd..d4ac91c 100644
--- a/cmd/web/handlers.go
+++ b/cmd/web/handlers.go
@@ -58,6 +58,10 @@ func (app *application) home(w http.ResponseWriter, r *http.Request) {
}
}
+func (app *application) organisationView(w http.ResponseWriter, r *http.Request) {
+ w.Write([]byte("This is an organisation"))
+}
+
func (app *application) organisationCreate(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
w.Header().Set("Allow", http.MethodPost)