mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 19:11:25 +01:00
refactor(output): share the JSON, created-resource and batch tails
Mutations end with a.jsonResult or a.created instead of hand-rolled --json branches, the two identical jsonResult/writeMutationJSON helpers become one, and writeBatchJSON checks --json itself so batch commands share one tail. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
32 files changed
+87
-217
No files matched your search
@@ -380,10 +380,7 @@ $ tea team create acme ops --permission admin --all-repositories`,
|
||||
return err
|
||||
}
|
||||
a.done(cmd, "Created team %s (ID %d) with %s access", team.Slug(), team.ID, team.Access())
|
||||
if err := a.printURL(cmd, teamURL(target, team)); err != nil {
|
||||
return err
|
||||
}
|
||||
return a.jsonResult(cmd, team)
|
||||
return a.created(cmd, team, teamURL(target, team))
|
||||
},
|
||||
}
|
||||
flags.register(cmd, true)
|
||||
|
||||
Reference in new issue
Block a user