[TASK] add freshness
This commit is contained in:
parent
9d33f6deda
commit
c0ad2028fb
|
@ -99,8 +99,10 @@ func getGoodFreshness(w http.ResponseWriter, r *http.Request){
|
|||
http.Error(w, "the good was not found in database", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
fresh := good.FouledAt.Before(time.Now().Add(-time.Duration(3) * time.Hour * 24))
|
||||
fresh := false
|
||||
if good.FouledAt != nil {
|
||||
fresh = time.Now().Add(-time.Duration(3) * time.Hour * 24).Before(*good.FouledAt)
|
||||
}
|
||||
|
||||
log = log.WithField("type", r.Header.Get("Content-Type"))
|
||||
switch r.Header.Get("Content-Type") {
|
||||
|
|
|
@ -27,8 +27,13 @@
|
|||
<footer class="ui vertical footer segment">
|
||||
<div class="ui center aligned container">
|
||||
<p>© 2017 MM / Go - Team</p>
|
||||
</div
|
||||
</div>
|
||||
</footer>
|
||||
<script src="//cdn.jsdelivr.net/webshim/1.14.5/polyfiller.js"></script>
|
||||
<script>
|
||||
webshims.setOptions('forms-ext', {types: 'date'});
|
||||
webshims.polyfill('forms forms-ext');
|
||||
</script>
|
||||
<script src="/node_modules/angular/angular.min.js"></script>
|
||||
<script src="/node_modules/angular-animate/angular-animate.min.js"></script>
|
||||
<script src="/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>
|
||||
|
|
Reference in New Issue