feat(frontend): single-person mode in +page.server.ts load function
Loads documents whenever senderId is set, using the optional receiverId param to switch between single-person and bilateral query modes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,14 +16,14 @@ export async function load({ url, fetch }) {
|
||||
|
||||
const requests: Promise<void>[] = [];
|
||||
|
||||
if (senderId && receiverId) {
|
||||
if (senderId) {
|
||||
requests.push(
|
||||
api
|
||||
.GET('/api/documents/conversation', {
|
||||
params: {
|
||||
query: {
|
||||
senderId,
|
||||
receiverId,
|
||||
receiverId: receiverId || undefined,
|
||||
dir,
|
||||
from: from || undefined,
|
||||
to: to || undefined
|
||||
@@ -34,9 +34,7 @@ export async function load({ url, fetch }) {
|
||||
documents = data ?? [];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (senderId) {
|
||||
requests.push(
|
||||
api.GET('/api/persons/{id}', { params: { path: { id: senderId } } }).then(({ data }) => {
|
||||
const p = data as { firstName: string; lastName: string } | undefined;
|
||||
|
||||
Reference in New Issue
Block a user