/** * Generated by orval v8.4.2 🍺 * Do not edit manually. * DreamChat API * The DreamChat API documentation * OpenAPI spec version: 1.0.0 */ import type { CharacterResponseDto, CreateCharacterDto, UpdateCharacterDto } from '.././model'; import { customFetch } from '../../mutator/custom-fetch'; /** * @summary Create a new character */ export const getCharacterControllerCreateUrl = () => { return `http://localhost:3000/api/characters` } export const characterControllerCreate = async (createCharacterDto: CreateCharacterDto, options?: RequestInit): Promise => { return customFetch(getCharacterControllerCreateUrl(), { ...options, method: 'POST', headers: { 'Content-Type': 'application/json', ...options?.headers }, body: JSON.stringify( createCharacterDto,) } );} /** * @summary Get all characters for current user */ export const getCharacterControllerFindAllUrl = () => { return `http://localhost:3000/api/characters` } export const characterControllerFindAll = async ( options?: RequestInit): Promise => { return customFetch(getCharacterControllerFindAllUrl(), { ...options, method: 'GET' } );} /** * @summary Get character by ID */ export const getCharacterControllerFindOneUrl = (id: string,) => { return `http://localhost:3000/api/characters/${id}` } export const characterControllerFindOne = async (id: string, options?: RequestInit): Promise => { return customFetch(getCharacterControllerFindOneUrl(id), { ...options, method: 'GET' } );} /** * @summary Update character */ export const getCharacterControllerUpdateUrl = (id: string,) => { return `http://localhost:3000/api/characters/${id}` } export const characterControllerUpdate = async (id: string, updateCharacterDto: UpdateCharacterDto, options?: RequestInit): Promise => { return customFetch(getCharacterControllerUpdateUrl(id), { ...options, method: 'PUT', headers: { 'Content-Type': 'application/json', ...options?.headers }, body: JSON.stringify( updateCharacterDto,) } );} /** * @summary Delete character */ export const getCharacterControllerDeleteUrl = (id: string,) => { return `http://localhost:3000/api/characters/${id}` } export const characterControllerDelete = async (id: string, options?: RequestInit): Promise => { return customFetch(getCharacterControllerDeleteUrl(id), { ...options, method: 'DELETE' } );}