fix: TS errors in API queries and session list
- page_size -> size to match API schema - reverse -> filters.reverse to match SessionGet body type - session.name -> session.metadata?.name (Session type has no name field)
This commit is contained in:
@@ -15,7 +15,7 @@ export function useWorkspaces(page = 1, pageSize = 20) {
|
|||||||
queryKey: QK.workspaces(page, pageSize),
|
queryKey: QK.workspaces(page, pageSize),
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const { data, error } = await client.current.POST("/v3/workspaces/list", {
|
const { data, error } = await client.current.POST("/v3/workspaces/list", {
|
||||||
params: { query: { page, page_size: pageSize } },
|
params: { query: { page, size: pageSize } },
|
||||||
body: {},
|
body: {},
|
||||||
});
|
});
|
||||||
return data ?? err(error);
|
return data ?? err(error);
|
||||||
@@ -139,7 +139,7 @@ export function usePeers(workspaceId: string, page = 1, pageSize = 20) {
|
|||||||
const { data, error } = await client.current.POST(
|
const { data, error } = await client.current.POST(
|
||||||
"/v3/workspaces/{workspace_id}/peers/list",
|
"/v3/workspaces/{workspace_id}/peers/list",
|
||||||
{
|
{
|
||||||
params: { path: { workspace_id: workspaceId }, query: { page, page_size: pageSize } },
|
params: { path: { workspace_id: workspaceId }, query: { page, size: pageSize } },
|
||||||
body: {},
|
body: {},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -253,7 +253,7 @@ export function usePeerSessions(workspaceId: string, peerId: string, page = 1, p
|
|||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
path: { workspace_id: workspaceId, peer_id: peerId },
|
path: { workspace_id: workspaceId, peer_id: peerId },
|
||||||
query: { page, page_size: pageSize },
|
query: { page, size: pageSize },
|
||||||
},
|
},
|
||||||
body: {},
|
body: {},
|
||||||
},
|
},
|
||||||
@@ -323,9 +323,9 @@ export function useSessions(workspaceId: string, page = 1, pageSize = 20) {
|
|||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
path: { workspace_id: workspaceId },
|
path: { workspace_id: workspaceId },
|
||||||
query: { page, page_size: pageSize },
|
query: { page, size: pageSize },
|
||||||
},
|
},
|
||||||
body: { reverse: true },
|
body: { filters: { reverse: true } },
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return data ?? err(error);
|
return data ?? err(error);
|
||||||
@@ -412,7 +412,7 @@ export function useSessionMessages(
|
|||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
path: { workspace_id: workspaceId, session_id: sessionId },
|
path: { workspace_id: workspaceId, session_id: sessionId },
|
||||||
query: { page, page_size: pageSize },
|
query: { page, size: pageSize },
|
||||||
},
|
},
|
||||||
body: {},
|
body: {},
|
||||||
},
|
},
|
||||||
@@ -642,7 +642,7 @@ export function useConclusions(
|
|||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
path: { workspace_id: workspaceId },
|
path: { workspace_id: workspaceId },
|
||||||
query: { page, page_size: pageSize, reverse },
|
query: { page, size: pageSize, reverse },
|
||||||
},
|
},
|
||||||
body: filters,
|
body: filters,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export function SessionList() {
|
|||||||
className="font-mono text-sm font-medium truncate"
|
className="font-mono text-sm font-medium truncate"
|
||||||
style={{ color: COLOR.accentSoft }}
|
style={{ color: COLOR.accentSoft }}
|
||||||
>
|
>
|
||||||
{session.name || mask(session.id)}
|
{session.metadata?.name || mask(session.id)}
|
||||||
</span>
|
</span>
|
||||||
<div className="flex items-center gap-2 shrink-0 ml-2">
|
<div className="flex items-center gap-2 shrink-0 ml-2">
|
||||||
{session.is_active && (
|
{session.is_active && (
|
||||||
|
|||||||
Reference in New Issue
Block a user