replies.ts•1.32 kB
/**
* Generated by orval v7.2.0 🍺
* Do not edit manually.
* storyden
* Storyden social API for building community driven platforms.
The Storyden API does not adhere to semantic versioning but instead applies a rolling strategy with deprecations and minimal breaking changes. This has been done mainly for a simpler development process and it may be changed to a more fixed versioning strategy in the future. Ultimately, the primary way Storyden tracks versions is dates, there are no set release tags currently.
* OpenAPI spec version: v1.25.8-canary
*/
import type { ReplyCreateBody, ReplyCreateOKResponse } from "../openapi-schema";
import { fetcher } from "../server";
/**
* Create a new post within a thread.
*/
export type replyCreateResponse = {
data: ReplyCreateOKResponse;
status: number;
};
export const getReplyCreateUrl = (threadMark: string) => {
return `/threads/${threadMark}/replies`;
};
export const replyCreate = async (
threadMark: string,
replyCreateBody: ReplyCreateBody,
options?: RequestInit,
): Promise<replyCreateResponse> => {
return fetcher<Promise<replyCreateResponse>>(getReplyCreateUrl(threadMark), {
...options,
method: "POST",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(replyCreateBody),
});
};