forked from forgejo/forgejo
[refactor] Unify the export of user data via API (#15144)
* [refactor] unify how user data is exported via API * test time via unix timestamp
This commit is contained in:
parent
f4d27498bd
commit
290cf75f93
26 changed files with 117 additions and 97 deletions
|
@ -116,7 +116,7 @@ func CreateUser(ctx *context.APIContext) {
|
|||
if form.SendNotify {
|
||||
mailer.SendRegisterNotifyMail(ctx.Locale, u)
|
||||
}
|
||||
ctx.JSON(http.StatusCreated, convert.ToUser(u, ctx.IsSigned, ctx.User.IsAdmin))
|
||||
ctx.JSON(http.StatusCreated, convert.ToUser(u, ctx.User))
|
||||
}
|
||||
|
||||
// EditUser api for modifying a user's information
|
||||
|
@ -238,7 +238,7 @@ func EditUser(ctx *context.APIContext) {
|
|||
}
|
||||
log.Trace("Account profile updated by admin (%s): %s", ctx.User.Name, u.Name)
|
||||
|
||||
ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.IsSigned, ctx.User.IsAdmin))
|
||||
ctx.JSON(http.StatusOK, convert.ToUser(u, ctx.User))
|
||||
}
|
||||
|
||||
// DeleteUser api for deleting a user
|
||||
|
@ -403,7 +403,7 @@ func GetAllUsers(ctx *context.APIContext) {
|
|||
|
||||
results := make([]*api.User, len(users))
|
||||
for i := range users {
|
||||
results[i] = convert.ToUser(users[i], ctx.IsSigned, ctx.User.IsAdmin)
|
||||
results[i] = convert.ToUser(users[i], ctx.User)
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(int(maxResults), listOptions.PageSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue