Skip to content

Commit

Permalink
Route name (#2520)
Browse files Browse the repository at this point in the history
* clearer refresh logic

* rename path
  • Loading branch information
pablonyx authored Sep 20, 2024
1 parent c82a36a commit 5f26449
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/app/admin/assistants/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export const togglePersonaVisibility = async (
personaId: number,
isVisible: boolean
) => {
const response = await fetch(`/api/persona/${personaId}/visible`, {
const response = await fetch(`/api/admin/persona/${personaId}/visible`, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Expand Down
7 changes: 6 additions & 1 deletion web/src/app/assistants/mine/AssistantsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ export function AssistantsList({

const [currentlyVisibleAssistants, setCurrentlyVisibleAssistants] = useState<
Persona[]
>(orderAssistantsForUser(visibleAssistants, user));
>([]);

useEffect(() => {
const orderedAssistants = orderAssistantsForUser(visibleAssistants, user);
setCurrentlyVisibleAssistants(orderedAssistants);
}, [assistants, user]);

const ownedButHiddenAssistants = getUserCreatedAssistants(
user,
Expand Down

0 comments on commit 5f26449

Please sign in to comment.