Fetches and updates admin search configuration slots using typed API calls. Reuse when integrating search management endpoints into admin panels.
// Source: https://github.com/metadist/synaplan | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import type { z } from 'zod'
import {
GetAdminSearchConfigResponseSchema,
PutAdminSearchConfigResponseSchema,
type putAdminSearchConfig_Body,
} from '@/generated/api-schemas'
import { httpClient } from './httpClient'
export type AdminSearchConfig = z.infer<typeof GetAdminSearchConfigResponseSchema>
export type AdminSearchSlot = z.infer<typeof putAdminSearchConfig_Body>['slot']
export type AdminSearchChange = z.infer<typeof PutAdminSearchConfigResponseSchema>
export function getAdminSearchConfig(): Promise<AdminSearchConfig> {
return httpClient('/api/v1/admin/search/config', {
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key