Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9485e8cf
Commit
9485e8cf
authored
Nov 16, 2015
by
utkarshcmu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
/api/admin/users returns user ID
parent
305f8d69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
pkg/api/admin_users.go
+9
-2
pkg/models/user.go
+5
-0
No files found.
pkg/api/admin_users.go
View file @
9485e8cf
...
@@ -37,7 +37,14 @@ func AdminCreateUser(c *middleware.Context, form dtos.AdminCreateUserForm) {
...
@@ -37,7 +37,14 @@ func AdminCreateUser(c *middleware.Context, form dtos.AdminCreateUserForm) {
metrics
.
M_Api_Admin_User_Create
.
Inc
(
1
)
metrics
.
M_Api_Admin_User_Create
.
Inc
(
1
)
c
.
JsonOK
(
"User created"
)
user
:=
cmd
.
Result
result
:=
m
.
UserIdDTO
{
Message
:
"User created"
,
Id
:
user
.
Id
,
}
c
.
JSON
(
200
,
result
)
}
}
func
AdminUpdateUserPassword
(
c
*
middleware
.
Context
,
form
dtos
.
AdminUpdateUserPasswordForm
)
{
func
AdminUpdateUserPassword
(
c
*
middleware
.
Context
,
form
dtos
.
AdminUpdateUserPasswordForm
)
{
...
@@ -96,5 +103,5 @@ func AdminDeleteUser(c *middleware.Context) {
...
@@ -96,5 +103,5 @@ func AdminDeleteUser(c *middleware.Context) {
return
return
}
}
c
.
JsonOK
(
"User deleted"
)
c
.
JsonOK
(
"User deleted"
)
}
}
pkg/models/user.go
View file @
9485e8cf
...
@@ -157,3 +157,8 @@ type UserSearchHitDTO struct {
...
@@ -157,3 +157,8 @@ type UserSearchHitDTO struct {
Email
string
`json:"email"`
Email
string
`json:"email"`
IsAdmin
bool
`json:"isAdmin"`
IsAdmin
bool
`json:"isAdmin"`
}
}
type
UserIdDTO
struct
{
Id
int64
`json:"id"`
Message
string
`json:"message"`
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment