Quellcode durchsuchen

Ensure new estimates have correct user IDs

master
Immanuel Onyeka vor 1 Jahr
Ursprung
Commit
26cd32c82a
3 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen
  1. +8
    -0
      assets/main.css
  2. +4
    -2
      components/estimates.vue
  3. +2
    -0
      skouter.go

+ 8
- 0
assets/main.css Datei anzeigen

@@ -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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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 }


Laden…
Abbrechen
Speichern