Add download button

This commit is contained in:
Khanh Ngo 2020-04-25 16:58:14 +07:00
parent 6f0d7bf69f
commit 91f06914d4
No known key found for this signature in database
GPG key ID: D5FAA6A16150E49E
4 changed files with 50 additions and 3 deletions

View file

@ -224,3 +224,20 @@ func GetClients(hasQRCode bool) ([]model.ClientData, error) {
return clients, nil
}
// GetClientByID func to query a client from the database
func GetClientByID(clientID string) (model.Client, error) {
client := model.Client{}
db, err := DBConn()
if err != nil {
return client, err
}
// read client information
if err := db.Read("clients", clientID, &client); err != nil {
return client, err
}
return client, nil
}