mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-13 23:09:02 +00:00
monitoring setup, project dashboard, account page
This commit is contained in:
@@ -49,6 +49,12 @@ type GetAllProjectsResponse struct {
|
||||
Projects *[]storage.Project `json:"projects,omitempty"`
|
||||
}
|
||||
|
||||
type GetAssigneeStatsResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Assignees *[]storage.AssignedTasks `json:"assignees"`
|
||||
}
|
||||
|
||||
func (api *WebAPI) ProjectCreate(r *Request) {
|
||||
|
||||
createReq := &CreateProjectRequest{}
|
||||
@@ -203,3 +209,16 @@ func (api *WebAPI) ProjectGetAllProjects(r *Request) {
|
||||
Projects: projects,
|
||||
})
|
||||
}
|
||||
|
||||
func (api *WebAPI) ProjectGetAssigneeStats(r *Request) {
|
||||
|
||||
id, err := strconv.ParseInt(r.Ctx.UserValue("id").(string), 10, 64)
|
||||
handleErr(err, r) //todo handle invalid id
|
||||
|
||||
stats := api.Database.GetAssigneeStats(id, 16)
|
||||
|
||||
r.OkJson(GetAssigneeStatsResponse{
|
||||
Ok: true,
|
||||
Assignees: stats,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user