-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Assistants settings] Update reported
data backend
#871
base: main
Are you sure you want to change the base?
Conversation
256ee00
to
7bd937b
Compare
reported
data backend
@@ -21,6 +22,30 @@ async function assistantOnlyIfAuthor(locals: App.Locals, assistantId?: string) { | |||
return assistant; | |||
} | |||
|
|||
export async function load({ parent, params, locals }) { | |||
const data = await parent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this triggers the root's +layout.server.ts
's load
.
So each time we switch assistant, this will trigger a load of all assistants
IMO we can keep the redirect in page.ts
- that way the load isn't triggered - since the frontend will be able to execute it.
TLDR:
- Keep
page.ts
as is - remove the redirect /
parent()
call here - The rest of the PR is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled in 1d5994f
How does it work when you have both a server load function and a universal load function for the same |
// `data` comes from the server load function
export async function load({ parent, data }) {
const res = await parent();
// checks
...
return data;
} Something like that |
Only check if current assistant that is being viewed was
reported
.Previously, we were checking
reported
status on all the assistants of a user. However, thisreported
status is only useful for the assistant that is currently being viewed