Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sophie Daringer
webOps_RAST
Commits
6c4aeda1
Commit
6c4aeda1
authored
Apr 28, 2020
by
Tobias Kuhn
Browse files
fix things
parent
9a20418b
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/controllers/api/v1/money_transactions_controller.rb
View file @
6c4aeda1
...
...
@@ -51,6 +51,7 @@ class Api::V1::MoneyTransactionsController < Api::V1::BaseController
end
def
money_transaction_params
params
.
require
(
:money_transaction
).
permit
(
:creditor_id
,
:debitor_id
,
:amount
,
:paid_at
)
p
=
params
.
require
(
:data
).
permit
(
:type
,
attributes:
%i[amount paid_at]
,
relationships:
%i[creditor_id debitor_id]
)
p
[
:attributes
].
merge
(
p
[
:relationships
])
if
p
[
:type
]
==
'money_transaction'
end
end
config/initializers/cors.rb
View file @
6c4aeda1
Rails
.
application
.
config
.
middleware
.
insert_before
0
,
Rack
::
Cors
do
allow
do
origins
'*'
resource
'/*'
,
headers: :any
,
methods:
:get
resource
'/*'
,
headers: :any
,
methods:
%i(get post put patch delete options head)
end
allow
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment