public Token ExtendTime(TokenTime tt) { Token newToken = _tokens.Find(token => token.TokenString == tt.tokenString).FirstOrDefault(); newToken.ExtendTime(tt.time); _tokens.ReplaceOne(token => token.TokenString == tt.tokenString, newToken); return(newToken); }
public IActionResult ExtendTime([FromBody] TokenTime data) { Token token = _tokenService.Get(data.tokenString); if (token == null) { return(NotFound()); } Token newToken = _tokenService.ExtendTime(data); return(Ok(Utils.ToTokenTime(newToken))); }