OSDN Git Service

Password array (#316)
[bytom/bytom.git] / blockchain / accesstokens.go
index 153e559..4752a4e 100644 (file)
@@ -4,12 +4,8 @@ import (
        "context"
 
        log "github.com/sirupsen/logrus"
-
-       "github.com/bytom/errors"
 )
 
-var errCurrentToken = errors.New("token cannot delete itself")
-
 func (bcr *BlockchainReactor) createAccessToken(ctx context.Context, x struct {
        ID   string `json:"id"`
        Type string `json:"type"`
@@ -37,9 +33,9 @@ func (bcr *BlockchainReactor) deleteAccessToken(ctx context.Context, x struct {
 }) Response {
        //TODO Add delete permission verify.
        if err := bcr.accessTokens.Delete(ctx, x.ID); err != nil {
-               return resWrapper(nil, err)
+               return NewErrorResponse(err)
        }
-       return resWrapper(nil)
+       return NewSuccessResponse(nil)
 }
 
 func (bcr *BlockchainReactor) checkAccessToken(ctx context.Context, x struct {