react-native-frappe-fetch
A JavaScript library, mainly for React Native, in interacting with Frappe APIs.
The react-native-frappe-fetch uses Fetch API.
Installation
npm install react-native-frappe-fetch
Temporary Fix for Frappe v10
Currently, the codebase under the Frappe's app.py under v10 is not compatible with the react-native-frappe-fetch. However, the develop branch is already updated. Just replaced this with your make_form_dict()
function under app.py
.
import json if 'application/json' in (request.content_type or ') and request.data: args = else: args = request.form or request.args try: frappe.local.form_dict = except IndexError: frappe.local.form_dict = if "_" in frappe.local.form_dict: # _ is passed by $.ajax so that the request is not cached by the browser. So, remove _ from form_dict
Basic Usage
; // Connect to Frappe serverFrappeFetch; // Using the clientconst Client = FrappeFetch; // Post requests through APIconst data = doctype: "Test" name: "Name"; Client;
License
Copyright Bai Web and Mobile Lab. Released under the terms of the MIT lecense.