frontend: display issues related to the team

This commit is contained in:
nemunaire 2020-01-23 16:03:31 +01:00
commit a3ffdeae17
12 changed files with 238 additions and 12 deletions

View file

@ -96,6 +96,27 @@ func consumer() {
}
}
// Generate issues.json for a given team
func genTeamIssuesFile(team fic.Team) error {
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))
if s, err := os.Stat(dirPath); os.IsNotExist(err) {
os.MkdirAll(dirPath, 0777)
} else if !s.IsDir() {
return errors.New(fmt.Sprintf("%s is not a directory", dirPath))
}
if my, err := team.MyIssueFile(); err != nil {
return err
} else if j, err := json.Marshal(my); err != nil {
return err
} else if err = ioutil.WriteFile(path.Join(dirPath, "issues.json"), j, 0644); err != nil {
return err
}
return nil
}
// Generate my.json and wait.json for a given team
func genTeamMyFile(team *fic.Team) error {
dirPath := path.Join(TeamsDir, fmt.Sprintf("%d", team.Id))