Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
1b37e688
Unverified
Commit
1b37e688
authored
2 years ago
by
Bryan Maass
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixes some misses from http_actions routes (#23845)
- adds http_action PUT - returns the http_action data on h2.
parent
a9a1a49c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/api/action.clj
+14
-1
14 additions, 1 deletion
src/metabase/api/action.clj
src/metabase/models/action.clj
+1
-1
1 addition, 1 deletion
src/metabase/models/action.clj
with
15 additions
and
2 deletions
src/metabase/api/action.clj
+
14
−
1
View file @
1b37e688
...
...
@@ -99,6 +99,19 @@
(
when
(
not=
"http"
(
:type
action
))
(
throw
(
ex-info
(
trs
"Action type is not supported"
)
action
)))
(
let
[
http-action
(
db/insert!
HTTPAction
action
)]
(
first
(
action/select-actions
nil
:id
(
:action_id
http-action
)))))
(
if-let
[
action-id
(
:action_id
http-action
)]
(
first
(
action/select-actions
nil
:id
action-id
))
;; db/insert! does not return a value when used with h2
;; so we return the most recently updated http action.
(
last
(
action/select-actions
nil
:type
"http"
)))))
(
api/defendpoint
PUT
"/:id"
[
id
:as
{
action
:body
}
database
]
(
when
database
(
do-check-actions-enabled
database
nil
))
(
when
(
not=
"http"
(
:type
action
))
(
throw
(
ex-info
(
trs
"Action type is not supported"
)
action
)))
(
db/update!
HTTPAction
id
action
)
(
first
(
action/select-actions
nil
:id
id
)))
(
api/define-routes
actions/+check-actions-enabled
api/+check-superuser
)
This diff is collapsed.
Click to expand it.
src/metabase/models/action.clj
+
1
−
1
View file @
1b37e688
...
...
@@ -27,7 +27,7 @@
[
action
]
;; All possible sub-type columns
(
when-let
[
sub-type-action
(
not-empty
(
select-keys
action
[
:card_id
:name
:description
:template
:response_handle
:error_handle
]))]
(
assoc
sub-type-action
:action_id
(
:id
action
))))
(
assoc
sub-type-action
:action_id
(
or
(
:id
action
)
(
:action_id
action
))
)))
(
defn-
pre-delete
[
action
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment