discourse/app/serializers/basic_api_key_serializer.rb
Ted Johansson 0dc39fd560
UX: Show scope mode in API key list (#31605)
**Note:** Do not merge before the backfill (#31606) is merged.

### What is this change?

We're now storing the selected API key scope mode in the back-end, and
can display it in the API key list.

**Screenshot:**

<img width="551" alt="Screenshot 2025-03-04 at 7 27 42 PM"
src="https://github.com/user-attachments/assets/9f234242-cfaa-4a2c-93e9-740770bd9944"
/>
2025-03-11 10:00:42 +08:00

9 lines
327 B
Ruby

# frozen_string_literal: true
class BasicApiKeySerializer < ApplicationSerializer
attributes :id, :truncated_key, :scope_mode, :description, :created_at, :last_used_at, :revoked_at
has_one :user, serializer: BasicUserSerializer, embed: :objects
has_one :created_by, serializer: BasicUserSerializer, embed: :objects
end