Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(feedback-api): duplicate adminform feedback endpoints for /api/v3 #1589

Merged
merged 6 commits into from
Apr 13, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,7 @@ describe('admin-form.controller', () => {
})
})

describe('handleGetFormFeedbacks', () => {
describe('handleGetFormFeedback', () => {
const MOCK_USER_ID = new ObjectId().toHexString()
const MOCK_FORM_ID = new ObjectId().toHexString()
const MOCK_USER = {
Expand Down Expand Up @@ -2377,7 +2377,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2412,7 +2412,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2446,7 +2446,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2480,7 +2480,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2511,7 +2511,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand All @@ -2538,7 +2538,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2568,7 +2568,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down Expand Up @@ -2606,7 +2606,7 @@ describe('admin-form.controller', () => {
)

// Act
await AdminFormController.handleGetFormFeedbacks(
await AdminFormController.handleGetFormFeedback(
MOCK_REQ,
mockRes,
jest.fn(),
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/form/admin-form/admin-form.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export const handleStreamFormFeedback: RequestHandler<{
* @returns 422 when user in session cannot be retrieved from the database
* @returns 500 when database error occurs
*/
export const handleGetFormFeedbacks: RequestHandler<{
export const handleGetFormFeedback: RequestHandler<{
formId: string
}> = (req, res) => {
const { formId } = req.params
Expand All @@ -551,7 +551,7 @@ export const handleGetFormFeedbacks: RequestHandler<{
logger.error({
message: 'Error retrieving form feedbacks',
meta: {
action: 'handleGetFormFeedbacks',
action: 'handleGetFormFeedback',
...createReqMeta(req),
userId: sessionUserId,
formId,
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/form/admin-form/admin-form.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ AdminFormsRouter.get(
AdminFormsRouter.get(
'/:formId([a-fA-F0-9]{24})/adminform/feedback',
withUserAuthentication,
AdminFormController.handleGetFormFeedbacks,
AdminFormController.handleGetFormFeedback,
)

/**
Expand Down
Loading