2022-04-19 02:37:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-04-07 04:32:08 -05:00
|
|
|
class CvemonCvesController < ApplicationController
|
|
|
|
def index
|
|
|
|
@pocs = CvemonCve.all
|
2022-04-11 20:53:20 -05:00
|
|
|
render json: @pocs.to_json
|
2022-04-07 04:32:08 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
2022-04-19 02:37:27 -05:00
|
|
|
@poc = CvemonCve.find_by(id: params[:id])
|
2022-04-07 04:32:08 -05:00
|
|
|
render json: @poc.to_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def show_for_cve
|
2022-04-19 02:37:27 -05:00
|
|
|
@poc = CvemonCve.where(cve_id: params[:cve_id])
|
2022-04-07 04:32:08 -05:00
|
|
|
render json: @poc.to_json
|
|
|
|
end
|
|
|
|
|
|
|
|
def show_year
|
|
|
|
@cves_for_year = CvemonCve.from_year(params[:year])
|
|
|
|
render json: @cves_for_year.to_json
|
|
|
|
end
|
|
|
|
end
|