API Mod Download Links

Adds the tracked download links to the API.
This commit is contained in:
Refringe 2024-10-12 13:20:40 -06:00
parent f00c1a136b
commit 7559c85276
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
3 changed files with 3 additions and 9 deletions

View File

@ -53,11 +53,8 @@ class ModResource extends JsonResource
'type' => 'version',
'id' => $version->id,
],
// TODO: The download link to the version can be placed here, but I'd like to track the number of
// downloads that are made, so we'll need a new route/feature for that. #35
'links' => [
'self' => $version->link,
'self' => $version->downloadUrl(absolute: true),
],
])->toArray(),

View File

@ -28,10 +28,7 @@ class ModVersionResource extends JsonResource
// $this->description
//),
// TODO: The download link to the version can be placed here, but I'd like to track the number of
// downloads that are made, so we'll need a new route/feature for that. #35
'link' => $this->link,
'link' => $this->downloadUrl(absolute: true),
'virus_total_link' => $this->virus_total_link,
'downloads' => $this->downloads,
'created_at' => $this->created_at,

View File

@ -36,7 +36,7 @@ class UserResource extends JsonResource
],
'includes' => $this->when(
ApiController::shouldInclude('user_role'),
new UserRoleResource($this->role)
new UserRoleResource($this->role),
),
'links' => [
'self' => $this->profileUrl(),