Skip to content

Commit

Permalink
IMN-243 Refactor logic functions (part3) in catalog-process (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
taglioni-r authored Mar 6, 2024
1 parent bed4f01 commit 0968cae
Show file tree
Hide file tree
Showing 3 changed files with 197 additions and 264 deletions.
4 changes: 4 additions & 0 deletions packages/catalog-process/open-api/catalog-service-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ paths:
responses:
"200":
description: EService with draft descriptor updated.
content:
application/json:
schema:
$ref: "#/components/schemas/EService"
"400":
description: Invalid input
content:
Expand Down
7 changes: 5 additions & 2 deletions packages/catalog-process/src/routers/EServiceRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,16 @@ const eservicesRouter = (
authorizationMiddleware([ADMIN_ROLE, API_ROLE]),
async (req, res) => {
try {
await catalogService.updateDraftDescriptor(
const updatedEService = await catalogService.updateDraftDescriptor(
unsafeBrandId(req.params.eServiceId),
unsafeBrandId(req.params.descriptorId),
req.body,
req.ctx.authData
);
return res.status(200).end();
return res
.status(200)
.json(eServiceToApiEService(updatedEService))
.end();
} catch (error) {
const errorRes = makeApiProblem(error, updateDescriptorErrorMapper);
return res.status(errorRes.status).json(errorRes).end();
Expand Down
Loading

0 comments on commit 0968cae

Please sign in to comment.