(ctx context.Context, token *Token)
| 55 | } |
| 56 | |
| 57 | func (s *TokenService) UpdateToken(ctx context.Context, token *Token) (*Token, error) { |
| 58 | _, err := s.tokenCollection.UpdateOne(ctx, bson.M{"_id": token.ID}, bson.M{"$set": token}) |
| 59 | if err != nil { |
| 60 | return nil, err |
| 61 | } |
| 62 | return token, nil |
| 63 | } |
| 64 | |
| 65 | func (s *TokenService) DeleteToken(ctx context.Context, token *Token) error { |
| 66 | _, err := s.tokenCollection.DeleteOne(ctx, bson.M{"_id": token.ID}) |
no outgoing calls