admin: Insert $team assignee in db automatically

This commit is contained in:
nemunaire 2021-09-03 12:18:02 +02:00
commit abf0715dbf
4 changed files with 37 additions and 32 deletions

View file

@ -171,11 +171,11 @@ func clearClaims(_ httprouter.Params, _ []byte) (interface{}, error) {
func generateTeamIssuesFile(team fic.Team) error {
if my, err := team.MyIssueFile(); err != nil {
return err
return fmt.Errorf("Unable to generate issue FILE (tid=%d): %w", team.Id, err)
} else if j, err := json.Marshal(my); err != nil {
return err
return fmt.Errorf("Unable to encode issues' file JSON: %w", err)
} else if err = ioutil.WriteFile(path.Join(TeamsDir, fmt.Sprintf("%d", team.Id), "issues.json"), j, 0644); err != nil {
return err
return fmt.Errorf("Unable to write issues' file: %w", err)
}
return nil
}