-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7bdc025
commit 064a212
Showing
10 changed files
with
48 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Request, Response, NextFunction } from "express"; | ||
import { $admin } from "../../client"; | ||
|
||
/** | ||
* @swagger | ||
* /admin/session/{sessionId}/digital-planning-data: | ||
* get: | ||
* summary: Generates a Digital Planning Data payload | ||
* description: Generates a Digital Planning Data payload, based on the Digital Planning Data Open API schema | ||
* tags: | ||
* - admin | ||
* parameters: | ||
* - $ref: '#/components/parameters/sessionId' | ||
* security: | ||
* - userJWT: [] | ||
*/ | ||
export const getDigitalPlanningDataPayload = async ( | ||
req: Request, | ||
res: Response, | ||
next: NextFunction, | ||
) => { | ||
try { | ||
const { exportData } = await $admin.export.digitalPlanningDataPayload( | ||
req.params.sessionId, | ||
); | ||
res.set("content-type", "application/json"); | ||
return res.send(exportData); | ||
} catch (error) { | ||
return next({ | ||
message: | ||
"Failed to make Digital Planning Data payload: " + | ||
(error as Error).message, | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.