Frappe React SDKContact ↗Contact ↗ (opens in a new tab)
GitHubGitHub (opens in a new tab)
  • Introduction
  • Setup
    • Setup your local development server
    • Using Doppio
    • Using TypeScript
    • Using other React frameworks
  • Authentication
  • Database
    • Get a list of documents
    • Read a document
    • Create a document
    • Update a document
    • Delete a document
  • API Calls
    • GET
    • POST
    • PUT
    • DELETE
  • File Uploads
  • Search
  • Realtime Events
    • Document Events
    • DocType Events
    • Other Realtime Events
  • Introduction
  • Setup
    • Setup your local development server
    • Using Doppio
    • Using TypeScript
    • Using other React frameworks
  • Authentication
  • Database
    • Get a list of documents
    • Read a document
    • Create a document
    • Update a document
    • Delete a document
  • API Calls
    • GET
    • POST
    • PUT
    • DELETE
  • File Uploads
  • Search
  • Realtime Events
    • Document Events
    • DocType Events
    • Other Realtime Events
  • Contact ↗ (opens in a new tab)
Question? Give us feedback → (opens in a new tab)Edit this page
API Calls
DELETE

DELETE

export const MyDocumentDeleteCall = () => {
  const { call, result, loading, error, isCompleted, reset } = useFrappeDeleteCall(
    /** method **/
    'frappe.client.delete'
  );
 
  const deleteDoc = () => {
    call({
      //** params **/
      doctype: 'User',
      name: 'Administrator',
    });
  };
 
  const resetCall = () => {
    reset();
  };
 
  if (loading) {
    return <>Loading</>;
  }
  if (error) {
    return <>{JSON.stringify(error)}</>;
  }
  if (result) {
    return <p>{result}</p>;
  }
  return null;
};
PUTFile Uploads

Built by The Commit Company using Nextra