Sfoglia il codice sorgente

Ensure new estimates have correct user IDs

master
Immanuel Onyeka 1 anno fa
parent
commit
26cd32c82a
3 ha cambiato i file con 14 aggiunte e 2 eliminazioni
  1. +8
    -0
      assets/main.css
  2. +4
    -2
      components/estimates.vue
  3. +2
    -0
      skouter.go

+ 8
- 0
assets/main.css Vedi File

@@ -384,3 +384,11 @@ section.mi .row input[type=checkbox] {
top: 40px;
position: absolute;
}

section.estimates .entry {
margin: 10px 0;
}

section.estimates .entry:hover {
cursor: pointer;
}

+ 4
- 2
components/estimates.vue Vedi File

@@ -29,10 +29,12 @@



<section class="inputs">
<section class="inputs estimates">
<h3>Saved Estimates</h3>

<div v-for="e in estimates">{{e}}</div>
<div class="entry" v-for="e in estimates">
<span>{{e.id}} - {{e.property}} - ${{e.price/100}}</span>
</div>

</section>



+ 2
- 0
skouter.go Vedi File

@@ -1108,6 +1108,8 @@ func createEstimate(w http.ResponseWriter, db *sql.DB, r *http.Request) {
var estimate Estimate
err := json.NewDecoder(r.Body).Decode(&estimate)
if err != nil { http.Error(w, "Invalid fields.", 422); return }
claims, err := getClaims(r)
estimate.User = claims.Id

estimate, err = insertEstimate(db, estimate)
if err != nil { http.Error(w, err.Error(), 422); return }


Loading…
Annulla
Salva