Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add management api delete document endpoints #15600

Merged
merged 5 commits into from Jan 22, 2024

Conversation

Migaroez
Copy link
Contributor

@Migaroez Migaroez commented Jan 18, 2024

Description

This PR adds missing endpoints for deleting documents from anywhere and from the recycle bin specifically.

Testing example payloads

Create document type

{
  "alias": "testDocType",
  "name": "testDocType",
  "description": "testDocType",
  "icon": "umb:wand",
  "allowedAsRoot": true,
  "variesByCulture": false,
  "variesBySegment": false,
  "isElement": false,
  "properties": [
    {
      "id": "7A9B8D0F-EC59-440F-A47A-79C9C4E65D25",
      "sortOrder": 0,
      "alias": "testProperty",
      "name": "testProperty",
      "description": "testProperty",
      "dataTypeId": "0cc0eba1-9960-42c9-bf9b-60e150b429ae",
      "variesByCulture": false,
      "variesBySegment": false
    }
  ]
}

create document (use ID from location header in previous request)

{
  "values": [
    {
      "culture": null,
      "segment": null,
      "alias": "testProperty",
      "value": "testValue"
    }
  ],
  "variants": [
    {
      "culture": null,
      "segment": null,
      "name": "testDocument"
    }
  ],
  "parentId": null,
  "contentTypeId": "THETYPEIDHERE"
}

Testing

  • delete document that does not exist => fail
  • delete document from bin that does not exist => fail
  • move document to bin that does not exist => fail
  • create a document
    • delete it from the bin => fail
    • move it to bin => success
    • move it to bin => fail
    • delete it from bin => success
    • delete it from bin => fail
    • fetch the document => fail
  • create a document
    • delete it => success
    • fetch the document => fail
  • create a document
    • move it to bin => success
    • delete it (trough the document endpoint, not recycle bin) => success
    • fetch the document => fail

@Migaroez Migaroez changed the title V14/feature/delete document Add management api delete document endpoints Jan 18, 2024
Copy link
Member

@bergmania bergmania left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests out great, I only have a single concern which I'm pretty sure we can fix easily :)

@Migaroez Migaroez merged commit acc71b6 into v14/dev Jan 22, 2024
14 of 15 checks passed
@Migaroez Migaroez deleted the v14/feature/delete-document branch January 22, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants