mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-14 15:29:02 +00:00
More work on UI
This commit is contained in:
@@ -33,6 +33,12 @@ type GetProjectStatsResponse struct {
|
||||
Stats *storage.ProjectStats `json:"stats,omitempty"`
|
||||
}
|
||||
|
||||
type GetAllProjectsStatsResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Stats *[]storage.ProjectStats `json:"stats,omitempty"`
|
||||
}
|
||||
|
||||
func (api *WebAPI) ProjectCreate(r *Request) {
|
||||
|
||||
createReq := &CreateProjectRequest{}
|
||||
@@ -125,3 +131,13 @@ func (api *WebAPI) ProjectGetStats(r *Request) {
|
||||
}, 404)
|
||||
}
|
||||
}
|
||||
|
||||
func (api *WebAPI) ProjectGetAllStats(r *Request) {
|
||||
|
||||
stats := api.Database.GetAllProjectsStats()
|
||||
|
||||
r.OkJson(GetAllProjectsStatsResponse{
|
||||
Ok: true,
|
||||
Stats: stats,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user