Saltar al contenido principal

Function: usePut()

usePut<T>(apiName, endpointName, body?, urlOptions?): Promise<FetchResult<T>>

Defined in: src/core/services/http.service.ts:486

PUT helper over a registered API endpoint.

Type Parameters

T

T = unknown

Parameters

apiName

string

The registered API key.

endpointName

string

The endpoint key within the API.

body?

unknown

Optional request body (auto-serialized to JSON unless raw).

urlOptions?

UrlOptions

Optional URL building options.

Returns

Promise<FetchResult<T>>

A FetchResult with data or error.

Example

import { usePut } from "katanakit-js";

const result = await usePut("pokeapi", "updatePokemon", { name: "Raichu" }, { params: { id: 25 } });