Skip to content

Commit 6953d09

Browse files
committed
fix linter failures
1 parent 1793551 commit 6953d09

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

backend/app/api/assistants.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ async def delete_assistant(
9494
assistant = await storage.get_assistant(user["user_id"], aid)
9595
if not assistant:
9696
raise HTTPException(status_code=404, detail="Assistant not found")
97-
if not assistant.get('public') and assistant.get('user_id') != user["user_id"]:
98-
raise HTTPException(status_code=403, detail="Unauthorized to delete this assistant")
97+
if not assistant.get("public") and assistant.get("user_id") != user["user_id"]:
98+
raise HTTPException(
99+
status_code=403, detail="Unauthorized to delete this assistant"
100+
)
99101
await storage.delete_assistant(user["user_id"], aid)
100102
return {"status": "ok"}

backend/app/storage.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,10 @@ async def delete_thread(user_id: str, thread_id: str):
212212

213213

214214
async def delete_assistant(user_id: str, assistant_id: str):
215-
"""Delete an assistant by ID.
216-
217-
Args:
218-
user_id: The user's ID.
219-
assistant_id: The assistant's ID.
220-
221-
"""
215+
"""Delete an assistant by ID."""
222216
async with get_pg_pool().acquire() as conn:
223217
await conn.execute(
224218
"DELETE FROM assistant WHERE assistant_id = $1 AND user_id = $2",
225219
assistant_id,
226220
user_id,
227-
)
221+
)

frontend/src/components/ConfigList.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,21 @@ function ConfigItem(props: {
5454
>
5555
<PencilSquareIcon />
5656
</Link>
57-
<Link
57+
<button
5858
className="w-5"
5959
onClick={(event) => {
6060
event.stopPropagation();
6161
props.deleteConfig(props.config.assistant_id);
6262
}}
6363
>
6464
<TrashIcon />
65-
</Link>
65+
</button>
6666
</div>
6767
</div>
6868
</li>
6969
);
7070
}
7171

72-
7372
export function ConfigList(props: {
7473
configs: ConfigListProps["configs"];
7574
currentConfig: Config | null;
@@ -93,10 +92,10 @@ export function ConfigList(props: {
9392
deleteConfig={props.deleteConfig}
9493
/>
9594
)) ?? (
96-
<li className="leading-6 p-2 animate-pulse font-black text-gray-400 text-lg">
97-
...
98-
</li>
99-
)}
95+
<li className="leading-6 p-2 animate-pulse font-black text-gray-400 text-lg">
96+
...
97+
</li>
98+
)}
10099
</ul>
101100

102101
<div className="text-xs font-semibold leading-6 text-gray-400 mt-4">
@@ -114,10 +113,10 @@ export function ConfigList(props: {
114113
deleteConfig={props.deleteConfig}
115114
/>
116115
)) ?? (
117-
<li className="leading-6 p-2 animate-pulse font-black text-gray-400 text-lg">
118-
...
119-
</li>
120-
)}
116+
<li className="leading-6 p-2 animate-pulse font-black text-gray-400 text-lg">
117+
...
118+
</li>
119+
)}
121120
</ul>
122121
</>
123122
);

frontend/src/hooks/useConfigList.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ export function useConfigList(): ConfigListProps {
111111
await fetch(`/assistants/${assistantId}`, {
112112
method: "DELETE",
113113
});
114-
setConfigs(configs?.filter(config => config.assistant_id !== assistantId));
114+
setConfigs(
115+
(configs?.filter((config) => config.assistant_id !== assistantId)) || []
116+
);
115117
},
116118
[configs],
117119
);

0 commit comments

Comments
 (0)