Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nmaas Platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nmaas
nmaas Platform
Commits
193d5929
Commit
193d5929
authored
3 weeks ago
by
Lukasz Lopatowski
Browse files
Options
Downloads
Patches
Plain Diff
Fix response of webhook update
parent
a8dbfe8a
No related branches found
No related tags found
No related merge requests found
Pipeline
#94447
passed
3 weeks ago
Stage: test
Stage: sonar
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/geant/nmaas/portal/service/WebhookEventService.java
+7
-3
7 additions, 3 deletions
...a/net/geant/nmaas/portal/service/WebhookEventService.java
with
7 additions
and
3 deletions
src/main/java/net/geant/nmaas/portal/service/WebhookEventService.java
+
7
−
3
View file @
193d5929
...
@@ -36,10 +36,13 @@ public class WebhookEventService {
...
@@ -36,10 +36,13 @@ public class WebhookEventService {
}
}
public
WebhookEventDto
update
(
WebhookEventDto
webhookEventDto
)
throws
GeneralSecurityException
{
public
WebhookEventDto
update
(
WebhookEventDto
webhookEventDto
)
throws
GeneralSecurityException
{
WebhookEvent
webhookEvent
=
webhookRepository
.
findById
(
webhookEventDto
.
getId
()).
orElseThrow
(()
->
new
MissingElementException
(
WEBHOOK_EVENT_NOT_FOUND
));
WebhookEvent
webhookEvent
=
webhookRepository
.
findById
(
webhookEventDto
.
getId
())
.
orElseThrow
(()
->
new
MissingElementException
(
WEBHOOK_EVENT_NOT_FOUND
));
setWebhookEvent
(
webhookEvent
,
webhookEventDto
);
setWebhookEvent
(
webhookEvent
,
webhookEventDto
);
webhookEvent
=
webhookRepository
.
save
(
webhookEvent
);
webhookEvent
=
webhookRepository
.
save
(
webhookEvent
);
return
modelMapper
.
map
(
webhookEvent
,
WebhookEventDto
.
class
);
WebhookEventDto
dto
=
modelMapper
.
map
(
webhookEvent
,
WebhookEventDto
.
class
);
dto
.
setTokenValue
(
webhookEvent
.
getTokenValue
()
==
null
?
null
:
encryptionService
.
decrypt
(
webhookEvent
.
getTokenValue
()));
return
dto
;
}
}
private
void
setWebhookEvent
(
WebhookEvent
webhookEvent
,
WebhookEventDto
webhookEventDto
)
throws
GeneralSecurityException
{
private
void
setWebhookEvent
(
WebhookEvent
webhookEvent
,
WebhookEventDto
webhookEventDto
)
throws
GeneralSecurityException
{
...
@@ -51,7 +54,8 @@ public class WebhookEventService {
...
@@ -51,7 +54,8 @@ public class WebhookEventService {
}
}
public
void
remove
(
Long
id
)
{
public
void
remove
(
Long
id
)
{
WebhookEvent
webhookEvent
=
webhookRepository
.
findById
(
id
).
orElseThrow
(()
->
new
MissingElementException
(
WEBHOOK_EVENT_NOT_FOUND
));
WebhookEvent
webhookEvent
=
webhookRepository
.
findById
(
id
)
.
orElseThrow
(()
->
new
MissingElementException
(
WEBHOOK_EVENT_NOT_FOUND
));
webhookRepository
.
delete
(
webhookEvent
);
webhookRepository
.
delete
(
webhookEvent
);
}
}
...
...
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