mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
Add get podcasts api service
This commit is contained in:
parent
e7f3bfcd1f
commit
eca4580f76
1 changed files with 6 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import z from "zod";
|
||||
import {
|
||||
type DeletePodcastRequest,
|
||||
deletePodcastRequest,
|
||||
|
|
@ -9,11 +10,16 @@ import {
|
|||
getPodcastByChatIdRequest,
|
||||
type LoadPodcastRequest,
|
||||
loadPodcastRequest,
|
||||
podcast,
|
||||
} from "@/contracts/types/podcast.types";
|
||||
import { ValidationError } from "../error";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
class PodcastsApiService {
|
||||
getPodcasts = async () => {
|
||||
return baseApiService.get("/api/v1/podcasts", z.array(podcast));
|
||||
};
|
||||
|
||||
getPodcastByChatId = async (request: GetPodcastByChatIdRequest) => {
|
||||
// Validate the request
|
||||
const parsedRequest = getPodcastByChatIdRequest.safeParse(request);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue