Skip to content

Commit

Permalink
fix updateEvent controller
Browse files Browse the repository at this point in the history
  • Loading branch information
pzmarzly committed Jun 7, 2020
1 parent 0471dd4 commit c21f5dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions backend/app/controllers/event/updateEvent.js
Expand Up @@ -14,7 +14,6 @@ const bodySchema = yup.object().shape( {
id: yup.string().required(),
summary: yup.string().required().max( 200 ),
description: yup.string().default( '' ),
participants: yup.array( yup.string().email() ).default( [] ),
} );

module.exports = async ( req, res ) => {
Expand All @@ -28,13 +27,12 @@ module.exports = async ( req, res ) => {
const eventData = {
summary: body.summary,
description: body.description,
participants: body.participants,
};

const client = new CalendarClient();
const event = await client.updateEvent( params.calendar, body.eventId, eventData );
await client.updateEvent( params.calendar, body.id, eventData );

res.send( event );
res.send( {} );
}
catch ( e ) {
res.status( 400 ).send( e.message );
Expand Down

0 comments on commit c21f5dd

Please sign in to comment.