deletePage method

Future<bool> deletePage(
  1. String host,
  2. String docId,
  3. String pageId
)

Delete a specific page from a document.

host - The host server URL. docId - The ID of the document. pageId - The ID of the page to delete.

Returns a bool indicating whether the page was deleted successfully.

Implementation

Future<bool> deletePage(String host, String docId, String pageId) async {
  final url = '$host/api/storage/documents/$docId/pages/$pageId';
  try {
    final response = await http.delete(Uri.parse(url));
    return response.statusCode == 204;
  } catch (error) {
    return false;
  }
}