Incomplete implementation of createVotes
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"code.dlmw.ch/dlmw/qv/internal/models"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
@ -48,6 +49,18 @@ func (e *mockElectionModel) Insert(name string, tokens int, areVotersKnown bool,
|
||||
return 1, nil
|
||||
}
|
||||
|
||||
func (e *mockElectionModel) GetById(id int) (*models.Election, error) {
|
||||
return &models.Election{
|
||||
ID: id,
|
||||
Name: "Guy of the year",
|
||||
Tokens: 100,
|
||||
AreVotersKnown: false,
|
||||
MaxVoters: 10,
|
||||
CreatedAt: time.Now().String(),
|
||||
ExpiresAt: time.Now().Add(100 * time.Hour).String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
type mockVoterModel struct {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user