Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2024-02-10 | Adds the Get handler for organisation model and fixes | Matthew Lemon | 2 | -1/+24 | |
Also fixes the NotAuthorised response I was mistakenly getting when it should have been a 404. | |||||
2024-02-10 | Have added Insert handler for Organisation model | Matthew Lemon | 1 | -1/+13 | |
This is a straight forward wrapper around INSERT. Also added a clientError into a new helpers.go file. | |||||
2024-02-09 | Adds the Organisations model | Matthew Lemon | 1 | -0/+29 | |
We have separation of concerns: the model is initalised and passed into the app struct, therefore our database logic will not be tied to our handlers. Our model, with its methods, is nicely encapsulated. We can initialise it and pass it to our handlers as a dependency. We can in future create an interface to mock the OrganisationModel object to be used in unit testing. We can also switch databases (theoretically) but providing a -dsn command-line flag. |