MCPcopy Create free account
hub / github.com/TanStack/query / toggleProjectFavoriteOnServer

Function toggleProjectFavoriteOnServer

examples/lit/pagination/src/api.ts:132–146  ·  view source on GitHub ↗
(
  input: ToggleProjectFavoriteInput,
)

Source from the content-addressed store, hash-verified

130}
131
132export async function toggleProjectFavoriteOnServer(
133 input: ToggleProjectFavoriteInput,
134): Promise<ProjectMutationResponse> {
135 return requestJson<ProjectMutationResponse>(
136 new URL(`/api/projects/${input.id}`, API_BASE_URL),
137 {
138 method: 'PATCH',
139 headers: {
140 'content-type': 'application/json',
141 },
142 body: JSON.stringify({ isFavorite: input.isFavorite }),
143 },
144 `Failed to update project ${input.id}`,
145 )
146}
147
148export async function armNextProjectMutationFailureOnServer(): Promise<void> {
149 await requestJson<{ ok: true }>(

Callers 1

constructorMethod · 0.90

Calls 1

requestJsonFunction · 0.85

Tested by

no test coverage detected