Skip to content

Commit b728455

Browse files
committed
stuff
1 parent c2b76c4 commit b728455

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/routes/events.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const dynamoClient = new DynamoDBClient({
4848

4949
const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
5050
fastify.post<{ Body: EventPostRequest }>(
51-
"/",
51+
"/:id?",
5252
{
5353
schema: {
5454
body: requestJsonSchema,
@@ -60,7 +60,7 @@ const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
6060
},
6161
async (request, reply) => {
6262
try {
63-
const entryUUID = randomUUID().toString();
63+
const entryUUID = ((request.params) as any).id || randomUUID().toString();
6464
await dynamoClient.send(
6565
new PutItemCommand({
6666
TableName: config.DYNAMO_TABLE_NAME,
@@ -91,9 +91,6 @@ const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
9191
schema: {
9292
response: { 200: getResponseJsonSchema },
9393
},
94-
onRequest: async (request, reply) => {
95-
await fastify.authorize(request, reply, [AppRoles.MANAGER]);
96-
},
9794
},
9895
async (request, reply) => {
9996
try {

0 commit comments

Comments
 (0)