generated from knnativeflow/express-ts-boilerplate
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add forms/:formId/event endpoint (#2)
- Loading branch information
Showing
8 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,4 +82,4 @@ function _handleFile(request: AuthRequest): Promise<any> { | |
resolve() | ||
}) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ export class FormSchemaApi extends Controller { | |
return await FormSchemaService.getPrivate(id) | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Controller, Get, Route, Tags} from "tsoa" | ||
import Response from "common/Response" | ||
import {EventPublicDoc} from "models/Event" | ||
import EventService from "service/EventService" | ||
|
||
@Route() | ||
@Tags('Forms') | ||
export class FormsApi extends Controller { | ||
|
||
/** | ||
* Get public event by form id | ||
* @param formId form id | ||
*/ | ||
@Get('/forms/{formId}/event') | ||
public async getPublicEvent(formId: string): Promise<Response<EventPublicDoc>> { | ||
return await EventService.findPublicByFormId(formId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters