Rename quite a few methods

This commit is contained in:
Howl committed 2016-11-21 17:04:27 +01:00
1 parent 700170392a
commit 8dc5af9406
3 files changed
+8 -6

No files matched your search

+2
View File
@@ -1,5 +1,7 @@
// +build !windows
// TODO: Make all these methods POST
package v1
import (
+4 -4
View File
@@ -131,8 +131,8 @@ func TokenNewPOST(md common.MethodData) common.CodeMessager {
return r
}
// TokenSelfDeleteGET deletes the token the user is connecting with.
func TokenSelfDeleteGET(md common.MethodData) common.CodeMessager {
// TokenSelfDeletePOST deletes the token the user is connecting with.
func TokenSelfDeletePOST(md common.MethodData) common.CodeMessager {
if md.ID() == 0 {
return common.SimpleResponse(400, "How should we delete your token if you haven't even given us one?!")
}
@@ -199,9 +199,9 @@ func TokenSelfGET(md common.MethodData) common.CodeMessager {
return r
}
// TokenFixPrivilegesGET fixes the privileges on the token of the given user,
// TokenFixPrivilegesPOST fixes the privileges on the token of the given user,
// or of all the users if no user is given.
func TokenFixPrivilegesGET(md common.MethodData) common.CodeMessager {
func TokenFixPrivilegesPOST(md common.MethodData) common.CodeMessager {
id := common.Int(md.Query("id"))
if md.Query("id") == "self" {
id = md.ID()