From 7cac3075d07c23ab3b7399d875e8ee04c75bdabb Mon Sep 17 00:00:00 2001
From: elliot-100 <3186037+elliot-100@users.noreply.github.com>
Date: Mon, 21 Oct 2024 12:41:25 +0100
Subject: [PATCH] Refactor `Spond.update_event()` to use common `_get_entity()`

---
 spond/spond.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/spond/spond.py b/spond/spond.py
index a5431ef..e24f7ab 100644
--- a/spond/spond.py
+++ b/spond/spond.py
@@ -350,12 +350,7 @@ async def update_event(self, uid: str, updates: JSONDict):
         json results of post command
 
         """
-        if not self.events:
-            await self.get_events()
-        for event in self.events:
-            if event["id"] == uid:
-                break
-
+        event = await self._get_entity(self._EVENT, uid)
         url = f"{self.api_url}sponds/{uid}"
 
         base_event: JSONDict = {