import { template } from "./config";
import { type IServiceConfig, sendRequest } from "./utils";

const SERVICES: { [key: string]: IServiceConfig } = {
	SCHEMAS_SELECT_ALL: {
		...template,
		endpoint: "/schemas/select/all",
		method: "GET",
	},
	SCHEMAS: {
		...template,
		endpoint: "/schemas",
		method: "GET",
	},
};

const getSchemasSelectAll = async () => {
	return sendRequest(SERVICES.SCHEMAS_SELECT_ALL);
};

const getSchemas = async () => {
	return sendRequest(SERVICES.SCHEMAS);
};

export default {
	getSchemasSelectAll,
	getSchemas,
};
