From ef096c2c575f301efa70f4d8a50dd877dfe58edf Mon Sep 17 00:00:00 2001 From: an-lee Date: Tue, 3 Sep 2024 09:32:17 +0800 Subject: [PATCH] fix segments api (#1037) --- enjoy/src/api/client.ts | 4 ++-- enjoy/src/renderer/components/posts/post-recording.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enjoy/src/api/client.ts b/enjoy/src/api/client.ts index 7f40ffa1..1eb9f5ce 100644 --- a/enjoy/src/api/client.ts +++ b/enjoy/src/api/client.ts @@ -470,7 +470,7 @@ export class Client { return this.api.get(`/api/payments/${id}`); } - mineSegments(params?: { + segments(params?: { page?: number; segmentIndex?: number; targetId?: string; @@ -480,7 +480,7 @@ export class Client { segments: SegmentType[]; } & PagyResponseType > { - return this.api.get("/api/mine/segments", { + return this.api.get("/api/segments", { params: decamelizeKeys(params), }); } diff --git a/enjoy/src/renderer/components/posts/post-recording.tsx b/enjoy/src/renderer/components/posts/post-recording.tsx index 73789dd3..a30ccebc 100644 --- a/enjoy/src/renderer/components/posts/post-recording.tsx +++ b/enjoy/src/renderer/components/posts/post-recording.tsx @@ -18,7 +18,7 @@ export const PostRecording = (props: { if (!recording.targetId) return; webApi - .mineSegments({ + .segments({ targetId: recording.targetId, targetType: recording.targetType, segmentIndex: recording.referenceId,