[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)
|
http.Error(w, "the good was not found in database", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
fresh := false
|
||||||
fresh := good.FouledAt.Before(time.Now().Add(-time.Duration(3) * time.Hour * 24))
|
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"))
|
log = log.WithField("type", r.Header.Get("Content-Type"))
|
||||||
switch r.Header.Get("Content-Type") {
|
switch r.Header.Get("Content-Type") {
|
||||||
|
|
|
@ -27,8 +27,13 @@
|
||||||
<footer class="ui vertical footer segment">
|
<footer class="ui vertical footer segment">
|
||||||
<div class="ui center aligned container">
|
<div class="ui center aligned container">
|
||||||
<p>© 2017 MM / Go - Team</p>
|
<p>© 2017 MM / Go - Team</p>
|
||||||
</div
|
</div>
|
||||||
</footer>
|
</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/angular.min.js"></script>
|
||||||
<script src="/node_modules/angular-animate/angular-animate.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>
|
<script src="/node_modules/angular-ui-router/release/angular-ui-router.min.js"></script>
|
||||||
|
|
Reference in New Issue