import { ApiClient, type ApiClientOptions } from "../infra/client"
import type { ApiPath, ApiRequestBody } from "../infra/types"

export const SETTINGS_ROUTES = {
    INDEX: "/api/settings",
} as const satisfies Record<string, ApiPath>

export class SettingsClient extends ApiClient {
    constructor(baseUrl?: string, defaultOptions?: ApiClientOptions) {
        super(baseUrl, defaultOptions)
    }

    async fetch() {
        return this.get(SETTINGS_ROUTES.INDEX)
    }

    async update(payload: ApiRequestBody<typeof SETTINGS_ROUTES.INDEX, "put">) {
        return this.put(SETTINGS_ROUTES.INDEX, payload)
    }
}
