openboard
openboard copied to clipboard
Post Service Queries: Make Improvements Similar to Those made with User Service Queries
The post service returns responses (y) whose values are copied from the request (x). Instead of copying, the response values should come from another database query. Add those queries.
The upsert queries in post are also using db.Prepare() when it is not necessary. See http://go-database-sql.org/prepared.html for more information. Use instead db.Exec() similar to what was used in upsertRole() method in the qryuser.go.
When finding posts, the items returned should be limited. Include limit and lapse in the select query for finding posts, similar to how user posts are found.
A/C
- [x] blocked by #85
- method
upsertType()- [ ] doesn't need a query prepared with
db.Prepare(). - [ ] instead of setting
y.Nametox.Name, should query the database for the value ofy.Name
- [ ] doesn't need a query prepared with
- method
upsertPost()- [ ] instead of setting the fields in
ywith the fields fromx, query the database for the needed information - [ ] doesn't need a query prepared with
db.Prepare().
- [ ] instead of setting the fields in
- can follow what was done for
qryuser.goinupsertUser()in PR #86 - method
findPosts()- [ ] include limit and lapse in the select query, similar to how it is done for finding users.