File tree 4 files changed +45
-0
lines changed
4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ Feature : Attendee Importation
2
+ Scenario : POST /admin/attendees with a CSV file that contains attendee information
3
+ When I make a POST request to "/admin/attendees" with file:
4
+ """
5
+ token,display_name,
6
+ "fccfc8bfa07643a1ca8015cbe74f5f17","Aotoki",
7
+ "93dc46e553ac602b0d6c6d7307e523f1","Danny",
8
+ """
9
+ Then the response status should be 200
Original file line number Diff line number Diff line change 20
20
}
21
21
)
22
22
23
+ When (
24
+ 'I make a POST request to {string} with file:' ,
25
+ async function ( this : WorkerWorld , path : string , content : string ) {
26
+ const formData = new FormData ( )
27
+ formData . append ( 'file' , content )
28
+ this . apiResponse = await this . api . fetch ( `https://ccip.opass.app${ path } ` , {
29
+ method : 'POST' ,
30
+ headers : { 'Content-Type' : 'application/x-www-form-urlencoded' } ,
31
+ body : formData ,
32
+ } )
33
+ }
34
+ )
35
+
23
36
When (
24
37
'I make a PUT request to {string}:' ,
25
38
async function ( this : WorkerWorld , path : string , payload : string ) {
Original file line number Diff line number Diff line change
1
+ import { OpenAPIRoute , OpenAPIRouteSchema } from '@cloudflare/itty-router-openapi'
2
+ import { Post } from '@worker/router'
3
+ import { IRequest , status } from 'itty-router'
4
+
5
+ export type AttendeeRequest = IRequest
6
+
7
+ @Post ( '/admin/attendees' )
8
+ export class CreateAttendees extends OpenAPIRoute {
9
+ static schema : OpenAPIRouteSchema = {
10
+ summary : 'Creates attendees' ,
11
+ tags : [ 'Attendee' ] ,
12
+ responses : {
13
+ '200' : {
14
+ description : 'Creates attendees' ,
15
+ } ,
16
+ } ,
17
+ }
18
+
19
+ async handle ( _request : AttendeeRequest ) {
20
+ return status ( 200 )
21
+ }
22
+ }
Original file line number Diff line number Diff line change 1
1
export * from './announcement'
2
+ export * from './attendee'
2
3
export * from './landing'
3
4
export * from './status'
4
5
export * from './use'
You can’t perform that action at this time.
0 commit comments