Skip to content

Commit

Permalink
refactor(api): merge key access parts
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Oct 31, 2023
1 parent 2615e2d commit 7dabf00
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/api/Services/Repositories/FirestoreApiKeyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ public class FirestoreApiKeyRepository(FirestoreDb singleton) : IApiKeyRepositor
private readonly FirestoreDb _db = singleton;

public async Task<ApiKey> GetKey(string key) {
key = key.ToLowerInvariant();

var reference = _db.Collection("keys").Document(key);
var snapshot = await reference.GetSnapshotAsync();
var snapshot = await _db.Collection("keys").Document(key.ToLowerInvariant()).GetSnapshotAsync();

return snapshot.ConvertTo<ApiKey>();
}
Expand Down

0 comments on commit 7dabf00

Please sign in to comment.