add checkin
This commit is contained in:
@@ -2,6 +2,7 @@ package encounter
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
rw "github.com/karincake/risoles"
|
||||
sf "github.com/karincake/semprit"
|
||||
@@ -124,6 +125,13 @@ func (obj myBase) CheckIn(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
dto.Id = uint(id)
|
||||
|
||||
// validate startedAt
|
||||
if dto.StartedAt == nil {
|
||||
now := time.Now()
|
||||
dto.StartedAt = &now
|
||||
}
|
||||
|
||||
res, err := u.CheckIn(dto)
|
||||
rw.DataResponse(w, res, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user