File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ const dynamoClient = new DynamoDBClient({
48
48
49
49
const eventsPlugin : FastifyPluginAsync = async ( fastify , _options ) => {
50
50
fastify . post < { Body : EventPostRequest } > (
51
- "/" ,
51
+ "/:id? " ,
52
52
{
53
53
schema : {
54
54
body : requestJsonSchema ,
@@ -60,7 +60,7 @@ const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
60
60
} ,
61
61
async ( request , reply ) => {
62
62
try {
63
- const entryUUID = randomUUID ( ) . toString ( ) ;
63
+ const entryUUID = ( ( request . params ) as any ) . id || randomUUID ( ) . toString ( ) ;
64
64
await dynamoClient . send (
65
65
new PutItemCommand ( {
66
66
TableName : config . DYNAMO_TABLE_NAME ,
@@ -91,9 +91,6 @@ const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
91
91
schema : {
92
92
response : { 200 : getResponseJsonSchema } ,
93
93
} ,
94
- onRequest : async ( request , reply ) => {
95
- await fastify . authorize ( request , reply , [ AppRoles . MANAGER ] ) ;
96
- } ,
97
94
} ,
98
95
async ( request , reply ) => {
99
96
try {
You can’t perform that action at this time.
0 commit comments