refactor: removed soft deletes from announcement, dump, featured theme, playlist, track & profile (#108)

This commit is contained in:
Kyrch
2025-07-11 17:11:43 -03:00
committed by GitHub
parent c1f2235d24
commit 5f1f7672e6
47 changed files with 44 additions and 582 deletions
+3 -6
View File
@@ -4,9 +4,9 @@ title: Announcement Destroy
# Announcement Destroy Endpoint
The announcement destroy endpoint soft deletes an announcement and returns the deleted announcement resource.
The announcement destroy endpoint deletes an announcement and returns a confirmation message.
For example, the `/announcement/1` endpoint will soft delete the announcement of id '1' and return the deleted announcement resource.
For example, the `/announcement/1` endpoint will delete the announcement of id '1' and return a confirmation message.
## URL
@@ -20,8 +20,6 @@ DELETE /announcement/{id}
**Roles with Permission**: Admin
**Other Requirements**: Announcement must not be soft deleted
## Parameters
None
@@ -34,8 +32,7 @@ None
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
@@ -1,39 +0,0 @@
---
title: Announcement Force Delete
---
# Announcement Force Delete Endpoint
The announcement force delete endpoint hard deletes an announcement and returns a confirmation message.
For example, the `/forceDelete/announcement/1` endpoint will hard delete the announcement of id '1' and return a confirmation message.
## URL
```sh
DELETE /forceDelete/announcement/{id}
```
## Authentication
**Required Permission**: force delete announcement
**Roles with Permission**: Admin
## Parameters
None
## Response
```json
{
message: "The Announcement '1' was deleted.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/forceDelete/announcement/1
```
+2 -11
View File
@@ -6,7 +6,7 @@ title: Announcement
---
An announcement API resource represents a site-wide message to be broadcasted on the homepage.
An announcement API resource represents a site-wide message to be broadcasted on the homepage.
For example, if video streaming is disabled, the site staff may issue a "Video streaming has been disabled!" announcement.
@@ -18,7 +18,6 @@ For example, if video streaming is disabled, the site staff may issue a "Video s
| content | String | No | Yes | The announcement text |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
## Allowed Include Paths
@@ -28,20 +27,12 @@ None
**[Announcement Destroy](/admin/announcement/destroy/)**
The announcement destroy endpoint soft deletes an announcement and returns the deleted announcement resource.
**[Announcement Force Delete](/admin/announcement/forceDelete/)**
The announcement force delete endpoint hard deletes an announcement and returns a confirmation message.
The announcement destroy endpoint deletes an announcement and returns a confirmation message.
**[Announcement Index](/admin/announcement/index/)**
The announcement index endpoint displays a listing of announcement resources.
**[Announcement Restore](/admin/announcement/restore/)**
The announcement restore endpoint restores a soft deleted announcement and returns the restored announcement resource.
**[Announcement Show](/admin/announcement/show/)**
The announcement show endpoint returns an announcement resource.
+1 -5
View File
@@ -34,7 +34,6 @@ None
| content | Sort resources on the announcement text |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
| deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters
@@ -45,8 +44,6 @@ None
| content | Filter resources on the announcement text |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| deleted_at | Filter resources on the resource deletion date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
## Response
@@ -57,8 +54,7 @@ None
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
-47
View File
@@ -1,47 +0,0 @@
---
title: Announcement Restore
---
# Announcement Restore Endpoint
The announcement restore endpoint restores a soft deleted announcement and returns the restored announcement resource.
For example, the `/restore/announcement/1` endpoint will restore the soft deleted announcement of id '1' and return the restored announcement resource.
## URL
```sh
PATCH /restore/announcement/{id}
```
## Authentication
**Required Permission**: restore announcement
**Roles with Permission**: Admin
**Other Requirements**: Announcement must be soft deleted
## Parameters
None
## Response
```json
{
announcement: {
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/restore/announcement/1
```
+1 -2
View File
@@ -30,8 +30,7 @@ None
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -2
View File
@@ -34,8 +34,7 @@ POST /announcement
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -4
View File
@@ -20,8 +20,6 @@ PUT|PATCH /announcement/{id}
**Roles with Permission**: Admin
**Other Requirements**: Announcement must not be soft deleted
## Parameters
| Name | Required | Rules |
@@ -36,8 +34,7 @@ PUT|PATCH /announcement/{id}
id: id,
content: "content",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+2 -5
View File
@@ -4,9 +4,9 @@ title: Dump Destroy
# Dump Destroy Endpoint
The dump destroy endpoint soft deletes a dump and returns the deleted dump resource.
The dump destroy endpoint deletes a dump and returns a confirmation message.
For example, the `/dump/1` endpoint will soft delete the dump of id '1' and return the deleted dump resource.
For example, the `/dump/1` endpoint will delete the dump of id '1' and return a confirmation message.
## URL
@@ -20,8 +20,6 @@ DELETE /dump/{id}
**Roles with Permission**: Admin
**Other Requirements**: Dump must not be soft deleted
## Parameters
None
@@ -35,7 +33,6 @@ None
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link
}
}
-39
View File
@@ -1,39 +0,0 @@
---
title: Dump Force Delete
---
# Dump Force Delete Endpoint
The dump force delete endpoint hard deletes a dump and returns a confirmation message.
For example, the `/forceDelete/dump/1` endpoint will hard delete the dump of id '1' and return a confirmation message.
## URL
```sh
DELETE /forceDelete/dump/{id}
```
## Authentication
**Required Permission**: force delete dump
**Roles with Permission**: Admin
## Parameters
None
## Response
```json
{
message: "The Dump '1' was deleted.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/forceDelete/dump/1
```
+2 -11
View File
@@ -6,7 +6,7 @@ title: Dump
---
A dump API resource represents a database dump of selected tables at a given point in time.
A dump API resource represents a database dump of selected tables at a given point in time.
For example, the animethemes-db-dump-wiki-1663559663946.sql dump represents the database dump of wiki tables performed at 2022-09-19.
@@ -18,7 +18,6 @@ For example, the animethemes-db-dump-wiki-1663559663946.sql dump represents the
| path | String | No | Yes | The path of the file in storage |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
| link | String | No | Yes | The URL to download the file from storage |
## Allowed Include Paths
@@ -29,20 +28,12 @@ None
**[Dump Destroy](/admin/dump/destroy/)**
The dump destroy endpoint soft deletes a dump and returns the deleted dump resource.
**[Dump Force Delete](/admin/dump/forceDelete/)**
The dump force delete endpoint hard deletes a dump and returns a confirmation message.
The dump destroy endpoint deletes a dump and returns a confirmation message.
**[Dump Index](/admin/dump/index/)**
The dump index endpoint displays a listing of dump resources.
**[Dump Restore](/admin/dump/restore/)**
The dump restore endpoint restores a soft deleted dump and returns the restored dump resource.
**[Dump Show](/admin/dump/show/)**
The dump show endpoint returns a dump resource.
-4
View File
@@ -34,7 +34,6 @@ None
| path | Sort resources on the path of the file in storage |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
| deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters
@@ -45,8 +44,6 @@ None
| path | Filter resources on the path of the file in storage |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| deleted_at | Filter resources on the resource deletion date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
## Response
@@ -58,7 +55,6 @@ None
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link"
},
...
-48
View File
@@ -1,48 +0,0 @@
---
title: Dump Restore
---
# Dump Restore Endpoint
The dump restore endpoint restores a soft deleted dump and returns the restored dump resource.
For example, the `/restore/dump/1` endpoint will restore the soft deleted dump of id '1' and return the restored dump resource.
## URL
```sh
PATCH /restore/dump/{id}
```
## Authentication
**Required Permission**: restore dump
**Roles with Permission**: Admin
**Other Requirements**: Dump must be soft deleted
## Parameters
None
## Response
```json
{
dump: {
id: id,
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/restore/dump/1
```
-1
View File
@@ -31,7 +31,6 @@ None
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link"
}
}
-1
View File
@@ -35,7 +35,6 @@ POST /dump
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link"
}
}
-3
View File
@@ -20,8 +20,6 @@ PUT|PATCH /dump/{id}
**Roles with Permission**: Admin
**Other Requirements**: Dump must not be soft deleted
## Parameters
| Name | Required | Rules |
@@ -37,7 +35,6 @@ PUT|PATCH /dump/{id}
path: "path",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
link: "link"
}
}
+1 -2
View File
@@ -34,8 +34,7 @@ None
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+3 -6
View File
@@ -4,9 +4,9 @@ title: Featured Theme Destroy
# Featured Theme Destroy Endpoint
The featured theme destroy endpoint soft deletes a featured theme and returns the deleted featured theme resource.
The featured theme destroy endpoint deletes a featured theme and returns a confirmation message.
For example, the `/featuredtheme/1` endpoint will soft delete the featured theme of id '1' and return the deleted featured theme resource.
For example, the `/featuredtheme/1` endpoint will delete the featured theme of id '1' and return a confirmation message.
## URL
@@ -20,8 +20,6 @@ DELETE /featuredtheme/{id}
**Roles with Permission**: Admin
**Other Requirements**: Featured Theme must not be soft deleted
## Parameters
None
@@ -35,8 +33,7 @@ None
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
@@ -1,39 +0,0 @@
---
title: Featured Theme Force Delete
---
# Featured Theme Force Delete Endpoint
The featured theme force delete endpoint hard deletes a featured theme and returns a confirmation message.
For example, the `/forceDelete/featuredtheme/1` endpoint will hard delete the featured theme of id '1' and return a confirmation message.
## URL
```sh
DELETE /forceDelete/featuredtheme/{id}
```
## Authentication
**Required Permission**: force delete featured theme
**Roles with Permission**: Admin
## Parameters
None
## Response
```json
{
message: "The Featured Theme '1' was deleted.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/forceDelete/featuredtheme/1
```
+1 -10
View File
@@ -17,7 +17,6 @@ A featured theme API resource represents a video to be featured on the homepage
| end_at | Date | No | Yes | The end date of the resource |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
## Allowed Include Paths
@@ -39,20 +38,12 @@ The current featured theme show endpoint returns the first featured theme where
**[Featured Theme Destroy](/admin/featuredtheme/destroy/)**
The featured theme destroy endpoint soft deletes a featured theme and returns the deleted featured theme resource.
**[Featured Theme Force Delete](/admin/featuredtheme/forceDelete/)**
The featured theme force delete endpoint hard deletes a featured theme and returns a confirmation message.
The featured theme destroy endpoint deletes a featured theme and returns a confirmation message.
**[Featured Theme Index](/admin/featuredtheme/index/)**
The featured theme index endpoint displays a listing of featured theme resources.
**[Featured Theme Restore](/admin/featuredtheme/restore/)**
The featured theme restore endpoint restores a soft deleted featured theme and returns the restored featured theme resource.
**[Featured Theme Show](/admin/featuredtheme/show/)**
The featured theme show endpoint returns a featured theme resource.
+1 -5
View File
@@ -35,7 +35,6 @@ None
| end_at | Sort resources on the resource end date |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
| deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters
@@ -47,8 +46,6 @@ None
| end_at | Filter resources on the resource end date |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| deleted_at | Filter resources on the resource deletion date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
## Response
@@ -60,8 +57,7 @@ None
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
-48
View File
@@ -1,48 +0,0 @@
---
title: Featured Theme Restore
---
# Featured Theme Restore Endpoint
The featured theme restore endpoint restores a soft deleted featured theme and returns the restored featured theme resource.
For example, the `/restore/featuredtheme/1` endpoint will restore the soft deleted featured theme of id '1' and return the restored featured theme resource.
## URL
```sh
PATCH /restore/featuredtheme/{id}
```
## Authentication
**Required Permission**: restore featured theme
**Roles with Permission**: Admin
**Other Requirements**: Featured Theme must be soft deleted
## Parameters
None
## Response
```json
{
featuredtheme: {
id: id,
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/restore/featuredtheme/1
```
+1 -2
View File
@@ -34,8 +34,7 @@ GET /featuredtheme/{id}
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -2
View File
@@ -39,8 +39,7 @@ POST /featuredtheme
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -4
View File
@@ -20,8 +20,6 @@ PUT|PATCH /featuredtheme/{id}
**Roles with Permission**: Admin
**Other Requirements**: Featured Theme must not be soft deleted
## Parameters
| Name | Required | Rules |
@@ -41,8 +39,7 @@ PUT|PATCH /featuredtheme/{id}
start_at: "start_at",
end_at: "end_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -2
View File
@@ -43,8 +43,7 @@ GET /playlist/{id}/backward
{
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
+3 -4
View File
@@ -4,9 +4,9 @@ title: Playlist Destroy
# Playlist Destroy Endpoint
The playlist destroy endpoint soft deletes a playlist and returns the deleted playlist resource.
The playlist destroy endpoint deletes a playlist and returns a confirmation message.
For example, the `/playlist/N4hG` endpoint will soft delete the playlist of id N4hG and return the deleted playlist resource.
For example, the `/playlist/N4hG` endpoint will delete the playlist of id N4hG and return a confirmation message.
## URL
@@ -18,7 +18,7 @@ DELETE /playlist/{id}
**Required Permission**: delete playlist
**Other Requirements**: User must own playlist & playlist must not be soft deleted
**Other Requirements**: User must own playlist
## Parameters
@@ -35,7 +35,6 @@ None
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
-39
View File
@@ -1,39 +0,0 @@
---
title: Playlist Force Delete
---
# Playlist Force Delete Endpoint
The playlist force delete endpoint hard deletes a playlist and returns a confirmation message.
For example, the `/forceDelete/playlist/N4hG` endpoint will hard delete the playlist of id N4hG and return a confirmation message.
## URL
```sh
DELETE /forceDelete/playlist/{id}
```
## Authentication
**Required Permission**: force delete playlist
**Roles with Permission**: Admin
## Parameters
None
## Response
```json
{
message: "The Playlist 'Name' was deleted.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/forceDelete/playlist/N4hG
```
+1 -2
View File
@@ -43,8 +43,7 @@ GET /playlist/{id}/forward
{
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
+1 -10
View File
@@ -20,7 +20,6 @@ For example, a "/r/anime's Best OPs and EDs of 2022" playlist may contain a coll
| visibility | Enum | Yes | Yes | The state of who can see the playlist [Private, Unlisted, Public] |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
| views_count | Integer | No | No | The number of views recorded for the resource |
| tracks_exists | Boolean | No | No | The existence of tracks belonging to the resource |
| tracks_count | Integer | No | No | The number of tracks belonging to the resource |
@@ -37,20 +36,12 @@ For example, a "/r/anime's Best OPs and EDs of 2022" playlist may contain a coll
**[Playlist Destroy](/list/playlist/destroy/)**
The playlist destroy endpoint soft deletes a playlist and returns the deleted playlist resource.
**[Playlist Force Delete](/list/playlist/forceDelete/)**
The playlist force delete endpoint hard deletes a playlist and returns a confirmation message.
The playlist destroy endpoint deletes a playlist and returns a confirmation message.
**[Playlist Index](/list/playlist/index/)**
The playlist index endpoint displays a listing of playlist resources.
**[Playlist Restore](/list/playlist/restore/)**
The playlist restore endpoint restores a soft deleted playlist and returns the restored playlist resource.
**[Playlist Show](/list/playlist/show/)**
The playlist show endpoint returns a playlist resource.
-4
View File
@@ -41,7 +41,6 @@ GET /playlist/
| tracks_count | Sort resources on the number of tracks |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
| deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters
@@ -57,8 +56,6 @@ GET /playlist/
| tracks_count | Filter resources on the number of tracks |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| deleted_at | Filter resources on the resource deletion date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
| has | Filter resources on relations within allowed include paths |
## Response
@@ -73,7 +70,6 @@ GET /playlist/
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
-50
View File
@@ -1,50 +0,0 @@
---
title: Playlist Restore
---
# Playlist Restore Endpoint
The playlist restore endpoint restores a soft deleted playlist and returns the restored playlist resource.
For example, the `/restore/playlist/N4hG` endpoint will restore the soft deleted playlist of id N4hG and return the restored playlist resource.
## URL
```sh
PATCH /restore/playlist/{id}
```
## Authentication
**Required Permission**: restore playlist
**Other Requirements**: User must own playlist & playlist must be soft deleted
## Parameters
None
## Response
```json
{
playlist: {
id: "id",
name: "name",
description: "description",
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/restore/playlist/N4hG
```
-1
View File
@@ -38,7 +38,6 @@ GET /playlist/{id}
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
-1
View File
@@ -37,7 +37,6 @@ POST /playlist
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
+1 -2
View File
@@ -43,8 +43,7 @@ GET /playlist/{playlist:id}/track/{track:id}/backward
{
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
+4 -5
View File
@@ -4,9 +4,9 @@ title: Playlist Track Destroy
# Playlist Track Destroy Endpoint
The playlist track destroy endpoint soft deletes a playlist track and returns the deleted playlist track resource.
The playlist track destroy endpoint deletes a playlist track and returns a confirmation message.
For example, the `/playlist/N4hG/track/Q3hD` endpoint will soft delete the playlist track of id Q3hD and return the deleted playlist track resource.
For example, the `/playlist/N4hG/track/Q3hD` endpoint will delete the playlist track of id Q3hD and return a confirmation message.
The track will be dissociated from the list of tracks within the playlist.
@@ -20,7 +20,7 @@ DELETE /playlist/{id}/track/{id}
**Required Permission**: delete playlist track
**Other Requirements**: User must own playlist & playlist track must not be soft deleted
**Other Requirements**: User must own playlist
## Parameters
@@ -33,8 +33,7 @@ None
track: {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
@@ -1,39 +0,0 @@
---
title: Playlist Track Force Delete
---
# Playlist Track Force Delete Endpoint
The playlist track force delete endpoint hard deletes a playlist track and returns a confirmation message.
For example, the `/forceDelete/playlist/N4hG/track/Q3hD` endpoint will hard delete the playlist track of id Q3hD and return a confirmation message.
## URL
```sh
DELETE /forceDelete/playlist/{id}/track/{id}
```
## Authentication
**Required Permission**: force delete playlist
**Roles with Permission**: Admin
## Parameters
None
## Response
```json
{
message: "The Playlist Track 'Q3hD' was deleted.",
}
```
## Example
```bash
curl -X DELETE -H "Authorization: Bearer {token}" https://api.animethemes.moe/forceDelete/playlist/N4hG/track/Q3hD
```
+1 -2
View File
@@ -43,8 +43,7 @@ GET /playlist/{playlist:id}/track/{track:id}/forward
{
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
+1 -10
View File
@@ -17,7 +17,6 @@ For example, a "/r/anime's Best OPs and EDs of 2022" playlist may contain a trac
| id | String | No | Yes | The primary key of the resource |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
## Allowed Include Paths
@@ -34,20 +33,12 @@ For example, a "/r/anime's Best OPs and EDs of 2022" playlist may contain a trac
**[Playlist Track Destroy](/list/playlist/track/destroy/)**
The playlist track destroy endpoint soft deletes a playlist track and returns the deleted playlist track resource.
**[Playlist Track Force Delete](/list/playlist/track/forceDelete/)**
The playlist track force delete endpoint hard deletes a playlist track and returns a confirmation message.
The playlist track destroy endpoint deletes a playlist track and returns a confirmation message.
**[Playlist Track Index](/list/playlist/track/index/)**
The playlist track index endpoint displays a listing of playlist track resources.
**[Playlist Track Restore](/list/playlist/track/restore/)**
The playlist track restore endpoint restores a soft deleted playlist track and returns the restored playlist track resource.
**[Playlist Track Show](/list/playlist/track/show/)**
The playlist track show endpoint returns a playlist track resource.
+1 -5
View File
@@ -36,7 +36,6 @@ GET /playlist/{id}/track
| id | Sort resources on the primary key |
| created_at | Sort resources on the resource creation date |
| updated_at | Sort resources on the resource last modified date |
| deleted_at | Sort resources on the resource deletion date |
| random | Sort resources randomly. Ignored if other sort fields are provided. |
## Filters
@@ -47,8 +46,6 @@ GET /playlist/{id}/track
| video_id | Filter resources on related video ID |
| created_at | Filter resources on the resource creation date |
| updated_at | Filter resources on the resource last modified date |
| deleted_at | Filter resources on the resource deletion date |
| trashed | Filter resources on trashed (deleted) status [With, Without, Only] |
| has | Filter resources on relations within allowed include paths |
## Response
@@ -59,8 +56,7 @@ GET /playlist/{id}/track
{
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
},
...
],
-46
View File
@@ -1,46 +0,0 @@
---
title: Playlist Track Restore
---
# Playlist Track Restore Endpoint
The playlist track restore endpoint restores a soft deleted playlist track and returns the restored playlist track resource.
For example, the `/restore/playlist/N4hG/track/Q3hD` endpoint will restore the soft deleted playlist track of id Q3hD and return the restored playlist track resource.
The restored track will be appended to the end of the list of tracks in the playlist.
## URL
```sh
PATCH /restore/playlist/{id}/track/{id}
```
## Authentication
**Required Permission**: restore playlist track
**Other Requirements**: User must own playlist & playlist track must be soft deleted
## Parameters
None
## Response
```json
{
track: {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
}
}
```
## Example
```bash
curl -X PATCH -H "Authorization: Bearer {token}" https://api.animethemes.moe/restore/playlist/N4hG/track/Q3hD
```
+1 -2
View File
@@ -34,8 +34,7 @@ GET /playlist/{id}/track/{id}
track: {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+1 -2
View File
@@ -43,8 +43,7 @@ POST /playlist/{id}/track
track: {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
+4 -5
View File
@@ -4,9 +4,9 @@ title: Playlist Track Update
# Playlist Track Update Endpoint
The playlist track update endpoint updates a playlist track and returns the updated playlist track resource.
The playlist track update endpoint updates a playlist track and returns a confirmation message.
For example, the `/playlist/N4hG/track/Q3hD?next_id=2` endpoint will update the playlist track of id Q3hD next_id attribute and return the updated playlist track resource.
For example, the `/playlist/N4hG/track/Q3hD?next_id=2` endpoint will update the playlist track of id Q3hD next_id attribute and return a confirmation message.
If `next` is set, the track will be moved before the next track in the playlist.
@@ -22,7 +22,7 @@ PUT|PATCH /playlist/{id}/track/{id}
**Required Permission**: update playlist track
**Other Requirements**: User must own playlist & playlist track must not be soft deleted
**Other Requirements**: User must own playlist
## Parameters
@@ -40,8 +40,7 @@ PUT|PATCH /playlist/{id}/track/{id}
track: {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"
updated_at: "updated_at"
}
}
```
-3
View File
@@ -20,8 +20,6 @@ PUT|PATCH /playlist/{id}
**Other Requirements**: User must own playlist
**Other Requirements**: User must own playlist & playlist must not be soft deleted
## Parameters
| Name | Required | Rules |
@@ -41,7 +39,6 @@ PUT|PATCH /playlist/{id}
visibility: "visibility",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
views_count: views_count,
tracks_exists: tracks_exists,
tracks_count: tracks_count
+1 -1
View File
@@ -18,7 +18,7 @@ DELETE /playlistimage/{playlist:id}/{image:id}
**Required Permission**: delete playlist, delete image
**Other Requirements**: User must own playlist & playlist must not be soft deleted
**Other Requirements**: User must own playlist
## Parameters
+1 -1
View File
@@ -24,7 +24,7 @@ A playlist image API resource represents the association between a playlist and
**[Playlist Image Destroy](/list/playlistimage/destroy/)**
The playlist image destroy endpoint deletes a playlist image and returns the deleted playlist image resource.
The playlist image destroy endpoint deletes a playlist image and returns a confirmation message.
**[Playlist Image Index](/list/playlistimage/index/)**