import { handleFetch } from './helpers'; import { Documentation } from '../types/api'; export default class DocumentationApi { public static async getDocumentation(type: string): Promise { const response = await handleFetch(`/documentation/get/${type}`); return response.json(); } public static async saveDocumentation(type: string, documentation: Documentation): Promise { const response = await handleFetch(`/documentation/set`, { method: 'post', body: JSON.stringify({ type, documentation }), }); return response.json(); } }