mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-10 21:48:52 +00:00
Complete //todo's
This commit is contained in:
@@ -158,7 +158,13 @@ func (api *WebAPI) GetManagerList(r *Request) {
|
||||
func (api *WebAPI) GetManagerListWithRoleOn(r *Request) {
|
||||
|
||||
pid, err := strconv.ParseInt(r.Ctx.UserValue("id").(string), 10, 64)
|
||||
handleErr(err, r) //todo handle invalid id
|
||||
if err != nil || pid <= 0 {
|
||||
r.Json(JsonResponse{
|
||||
Ok: false,
|
||||
Message: "Invalid project id",
|
||||
}, 400)
|
||||
return
|
||||
}
|
||||
|
||||
sess := api.Session.StartFasthttp(r.Ctx)
|
||||
manager := sess.Get("manager")
|
||||
|
||||
@@ -27,13 +27,14 @@ func (r *Request) Json(object JsonResponse, code int) {
|
||||
logrus.WithError(err).WithFields(logrus.Fields{
|
||||
"code": code,
|
||||
}).Error("Error during json encoding of object")
|
||||
return
|
||||
}
|
||||
|
||||
r.Ctx.Response.SetStatusCode(code)
|
||||
r.Ctx.Response.Header.Set("Content-Type", "application/json")
|
||||
_, err = r.Ctx.Write(resp)
|
||||
if err != nil {
|
||||
panic(err) //todo handle differently
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -525,7 +525,6 @@ func (api *WebAPI) SetManagerRoleOnProject(r *Request) {
|
||||
func (api *WebAPI) SetSecret(r *Request) {
|
||||
|
||||
pid, err := strconv.ParseInt(r.Ctx.UserValue("id").(string), 10, 64)
|
||||
handleErr(err, r) //todo handle invalid id
|
||||
if err != nil || pid <= 0 {
|
||||
r.Json(JsonResponse{
|
||||
Ok: false,
|
||||
|
||||
@@ -66,7 +66,6 @@ func (api *WebAPI) SubmitTask(r *Request) {
|
||||
}
|
||||
|
||||
if createReq.UniqueString != "" {
|
||||
//TODO: Load key from config
|
||||
createReq.Hash64 = int64(siphash.Hash(1, 2, []byte(createReq.UniqueString)))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user