Class: Api::V5::PendingTransactionsController

Inherits:
BaseController
  • Object
show all
Includes:
Concerns::Authorization
Defined in:
app/controllers/api/v5/pending_transactions_controller.rb

Overview

typed: ignore frozen_string_literal: true

Constant Summary

Constants inherited from BaseController

BaseController::CACHE_NAMESPACE, BaseController::INTERNAL_SERVER_ERROR_MESSAGE, BaseController::ResponseSchema

Instance Method Summary collapse

Methods inherited from BaseController

#identity_cache_memoization

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from ResponseCacheConcern

#my_response_cache

Instance Method Details

#createObject



20
21
22
23
24
25
26
# File 'app/controllers/api/v5/pending_transactions_controller.rb', line 20

def create
  render json: {
    data: {},
    success: true,
    message: I18n.t('actions.reservation.created')
  }
end

#indexObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/api/v5/pending_transactions_controller.rb', line 8

def index
  pending_transactions = current_user.pending_transactions
  render json: ActiveModelSerializers::SerializableResource.new(pending_transactions, {
                                                                  serialization_context: serialization_context,
                                                                  serializer: ActiveModel::Serializer::CollectionSerializer,
                                                                  adapter: :json_api,
                                                                  each_serializer: Api::V5::PendingTransactionSerializer,
                                                                  include: ['restaurant', 'address',
                                                                            'restaurant.restaurant_packages']
                                                                }).as_json.merge(success: true, message: nil)
end