mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
add podcast api service
This commit is contained in:
parent
5361290315
commit
20cd1951b5
5 changed files with 54 additions and 22 deletions
|
|
@ -3,8 +3,8 @@ import {
|
|||
type GetPodcastByChatIdRequest,
|
||||
generatePodcastRequest,
|
||||
getPodcastByChatIdRequest,
|
||||
getPodcastByChatResponse,
|
||||
type Podcast,
|
||||
podcast,
|
||||
} from "@/contracts/types/podcast.types";
|
||||
import { ValidationError } from "../error";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
|
@ -22,7 +22,10 @@ class PodcastsApiService {
|
|||
throw new ValidationError(`Invalid request: ${errorMessage}`);
|
||||
}
|
||||
|
||||
return baseApiService.get(`/api/v1/podcasts/by-chat/${request.chat_id}`, podcast);
|
||||
return baseApiService.get(
|
||||
`/api/v1/podcasts/by-chat/${request.chat_id}`,
|
||||
getPodcastByChatResponse
|
||||
);
|
||||
};
|
||||
|
||||
generatePodcast = async (request: GeneratePodcastRequest) => {
|
||||
|
|
@ -38,7 +41,7 @@ class PodcastsApiService {
|
|||
}
|
||||
|
||||
return baseApiService.post(`/api/v1/podcasts/generate`, undefined, {
|
||||
body: request,
|
||||
body: parsedRequest.data,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue