Browse Source

Update documentation for the new /events/edit/ route

Matt Coles 9 years ago
parent
commit
f857338185
1 changed files with 25 additions and 0 deletions
  1. 25 0
      README.md

+ 25 - 0
README.md

@@ -28,6 +28,7 @@ Server for Integrated Project, powered by Express.js and Redis, listens for HTTP
28 28
     * __Events__
29 29
         * [/events/create/](#eventscreate) :white_check_mark:
30 30
         * [/events/view/:eventid](#eventsvieweventid) :white_check_mark:
31
+        * [/events/edit/:eventid](#eventsediteventid)
31 32
         * [/events/pending/](#eventspending) :white_check_mark:
32 33
         * [/events/accepted/](#eventsaccepted) :white_check_mark:
33 34
         * [/events/declined/](#eventsdeclined) :white_check_mark:
@@ -457,6 +458,30 @@ The response will then look like this:
457 458
 The error codes are as follows, `1` indicates that the event does not exist, and
458 459
 `2` indicates a malformed request.
459 460
 
461
+### /events/edit/:eventid
462
+To create a new event, a `PUT` request should be sent with the following data:
463
+```javascript
464
+{
465
+    "name": "Test Event",
466
+    "location": "Test Location",
467
+    "start": "1460552065702",
468
+    "end": "1460552065734",
469
+    "details": "Some details about the test event",
470
+    "auth": "$2a$10$qjkvbcPZ4YC7/a/I0ZpTaeJp6auXjGrG9pgAdI3PP61u4CftQPSL2"
471
+}
472
+```
473
+Note that the end time of the event must be greater than the start time and the
474
+start time must be greater than Date.now().
475
+```javascript
476
+{
477
+    "success": 1,
478
+    "error": 0
479
+}
480
+```
481
+The error codes are as follows, `1` indicates that the user is not an admin of the society,
482
+`2` indicates that the event could not be found, `3` indicates that the start
483
+or end times were in some way invalid and `4` indicates a malformed request.
484
+
460 485
 ### /events/pending/
461 486
 To get a users pending events, a `GET` request should be sent with the following
462 487
 data: