From 7dabf001537c3b808827188b17047e7ce9cadcc9 Mon Sep 17 00:00:00 2001 From: steveoh Date: Tue, 31 Oct 2023 11:51:06 -0600 Subject: [PATCH] refactor(api): merge key access parts --- src/api/Services/Repositories/FirestoreApiKeyRepository.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/api/Services/Repositories/FirestoreApiKeyRepository.cs b/src/api/Services/Repositories/FirestoreApiKeyRepository.cs index f7288f84..f478a5a4 100644 --- a/src/api/Services/Repositories/FirestoreApiKeyRepository.cs +++ b/src/api/Services/Repositories/FirestoreApiKeyRepository.cs @@ -6,10 +6,7 @@ public class FirestoreApiKeyRepository(FirestoreDb singleton) : IApiKeyRepositor private readonly FirestoreDb _db = singleton; public async Task 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(); }