Use a standardized transformer base; replace all client transformers to call that base
This commit is contained in:
parent
2203a4d87e
commit
cf500a1a54
25 changed files with 255 additions and 379 deletions
|
@ -3,15 +3,16 @@
|
|||
namespace Pterodactyl\Transformers\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\WebauthnKey;
|
||||
use Pterodactyl\Transformers\Api\Transformer;
|
||||
|
||||
class WebauthnKeyTransformer extends BaseClientTransformer
|
||||
class WebauthnKeyTransformer extends Transformer
|
||||
{
|
||||
/**
|
||||
* Return the resource name for the JSONAPI output.
|
||||
*/
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return 'webauthn_key';
|
||||
return WebauthnKey::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,8 +23,7 @@ class WebauthnKeyTransformer extends BaseClientTransformer
|
|||
return [
|
||||
'id' => $model->id,
|
||||
'name' => $model->name,
|
||||
'created_at' => $model->created_at->toIso8601String(),
|
||||
'last_used_at' => now()->toIso8601String(),
|
||||
'created_at' => self::formatTimestamp($model->created_at),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue