deleteResource
删除资源。
const deleted = await drupal.deleteResource( type, uuid, options?: { withAuth, }): Promise<boolean>类型: 字符串- 必填
- 资源类型。例如:
node--article、taxonomy_term--tags或block_content--basic。
uuid: 字符串- 必填
- 资源 ID。例如
a50ffee7-ba94-46c9-9705-f9f8f440db94。
选项- 可选
withAuth: 布尔值 | DrupalClientAuth:- 设置要使用的身份验证方法。请参阅 身份验证文档。
- 设置为
true以使用在客户端上配置的身份验证方法。
示例
- 删除
node--page资源。
const isDeleted = await drupal.deleteResource( "node--page", "a50ffee7-ba94-46c9-9705-f9f8f440db94")