db.ReadAll zu db.ReadAllBriefings umbenannt, um neue DB-Struktur besser zu representieren
This commit is contained in:
parent
664c24974b
commit
230d79c675
@ -115,7 +115,7 @@ func (db *DB) WriteBriefing(b *types.Briefing) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) ReadAll() ([]*types.Briefing, error) {
|
func (db *DB) ReadAllBriefings() ([]*types.Briefing, error) {
|
||||||
bs := make([]*types.Briefing, 0)
|
bs := make([]*types.Briefing, 0)
|
||||||
|
|
||||||
rows, err := db.Query("SELECT * FROM " + db.Name)
|
rows, err := db.Query("SELECT * FROM " + db.Name)
|
||||||
|
@ -23,7 +23,7 @@ type questionData struct {
|
|||||||
|
|
||||||
func DisplayTable(db *data.DB) http.HandlerFunc {
|
func DisplayTable(db *data.DB) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
bs, err := db.ReadAll()
|
bs, err := db.ReadAllBriefings()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = fmt.Errorf("DisplayTable: %v\n", err)
|
_ = fmt.Errorf("DisplayTable: %v\n", err)
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@ func SubmitForm(db *data.DB, i, j *int64) http.HandlerFunc {
|
|||||||
|
|
||||||
log.Println(b)
|
log.Println(b)
|
||||||
db.WriteBriefing(b)
|
db.WriteBriefing(b)
|
||||||
bs, err := db.ReadAll()
|
bs, err := db.ReadAllBriefings()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = fmt.Errorf("SubmitForm: db.ReadAll(): %v\n", err)
|
_ = fmt.Errorf("SubmitForm: db.ReadAll(): %v\n", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user