1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 13:05:21 +02:00
mealie/dev/scripts/templates/js_requests.j2
Hayden e34079673c
Docs/v0.5.0 second pass (#496)
* update docs

* use auto-gen routes

* dumb deps

* remove whitespace

* github action to build dev docs container

* no cache

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-06-11 21:57:59 -08:00

19 lines
No EOL
900 B
Django/Jinja

// This Content is Auto Generated
import { API_ROUTES } from "./apiRoutes"
export const {{paths.export_name}}API = { {% for path in paths.all_paths %} {% for verb in path.http_verbs %} {% if path.route_object.is_function %}
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
* @param {{ v }} {% endfor %}
*/
{{ verb.summary_camel }}({{path.route_object.var|join(", ")}}) {
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }}({{path.route_object.var|join(", ")}}))
return response.data
}, {% else %}
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
* @param {{ v }} {% endfor %}
*/
{{ verb.summary_camel }}() {
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }})
return response.data
},{% endif %} {% endfor %} {% endfor %}
}