Skip to content

Commit

Permalink
Fix issue with sharing agents
Browse files Browse the repository at this point in the history
  • Loading branch information
homanp committed Jul 26, 2023
1 parent 52b506a commit 476a047
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/api/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async def delete_agent(agentId: str, token=Depends(JWTBearer())):
)
async def patch_agent(agentId: str, body: dict, token=Depends(JWTBearer())):
"""Patch agent endpoint"""
tags = body["tags"]
tags = body.get("tags")
if tags or tags == []:
body["tags"] = json.dumps(tags)

Expand Down
6 changes: 2 additions & 4 deletions ui/app/_components/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function AnalyticsProvider({ children }) {
session.status === "authenticated" &&
previousSession?.status !== "authenticated"
) {
analytics.identify(session.data.user.user.id, {
analytics.identify(session.data.user?.user?.id, {
...session.data.user.user,
});
}
Expand All @@ -40,9 +40,7 @@ export function Providers({ children }) {
<SessionProvider>
<AnalyticsProvider>
<CacheProvider>
<SaasProvider theme={glassTheme}>
{children}
</SaasProvider>
<SaasProvider theme={glassTheme}>{children}</SaasProvider>
</CacheProvider>
</AnalyticsProvider>
</SessionProvider>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/agents/[agentId]/_components/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function AgentNavbar({ agent, apiToken, hasApiTokenWarning }) {

const api = new API(session.data);

await api.patchAgent({ id: agent.id, isPublic: event.target.checked });
await api.patchAgent(agent.id, { isPublic: event.target.checked });

router.refresh();
setIsChangingShareStatus();
Expand Down

0 comments on commit 476a047

Please sign in to comment.