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

Refs #37989 - Pluralize api docs endpoint and other changes #11223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/katello/api/v2/flatpak_remotes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Api::V2::FlatpakRemotesController < Katello::Api::V2::ApiController
api :GET, "/flatpak_remotes", N_("List flatpak remotes")
param :organization_id, :number, :desc => N_("organization identifier"), :required => false
param :name, String, :desc => N_("Name of the flatpak remote"), :required => false
param :label, String, :desc => N_("Label of the flatpak remote"), :required => false
param_group :search, Api::V2::ApiController
add_scoped_search_description_for(FlatpakRemote)
def index
Expand All @@ -40,10 +39,11 @@ def show
respond :resource => @flatpak_remote
end

api :POST, "/flatpak_remote", N_("Create a flatpak remote")
api :POST, "/flatpak_remotes", N_("Create a flatpak remote")
param :name, String, :desc => N_("name"), :required => true
param :url, String, :desc => N_("url"), :required => true
param :organization_id, :number, :desc => N_("organization identifier"), :required => true
param :registry_url, String, :desc => N_("Optional Registry url. Will be updated when remote is scanned.")
param_group :flatpak_remote
def create
flatpak_remote = FlatpakRemote.new(flatpak_remote_params)
Expand All @@ -67,7 +67,7 @@ def destroy
@flatpak_remote.destroy
end

api :POST, "/flatpak_remote/:id/scan", N_("Scan a flatpak remote")
api :POST, "/flatpak_remotes/:id/scan", N_("Scan a flatpak remote")
param :id, :number, :desc => N_("Flatpak remote numeric identifier"), :required => true
def scan
task = async_task(::Actions::Katello::Flatpak::ScanRemote, @flatpak_remote)
Expand Down
1 change: 1 addition & 0 deletions app/models/katello/flatpak_remote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class FlatpakRemote < Katello::Model
validates :name, presence: true
validates :url, presence: true
validates :organization_id, presence: true
validates :name, :uniqueness => {:scope => :organization_id}

scope :seeded, -> { where(:seeded => true) }

Expand Down
Loading