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

Fix server-side divergences between form-v2/develop and develop branch #3472

Closed
9 of 11 tasks
karrui opened this issue Feb 21, 2022 · 1 comment
Closed
9 of 11 tasks
Assignees
Labels

Comments

@karrui
Copy link
Contributor

karrui commented Feb 21, 2022

This issue keeps track of the various server-side divergences between the form-v2/develop and develop branch, so we hopefully only need to migrate infra + react related code instead of also having to check for server-side variances.

  • shared/constants/form.ts
    Screenshot 2022-02-21 at 6 58 12 PM

  • shared/types/core.ts
    Screenshot 2022-02-21 at 6 58 40 PM

  • shared/types/form/form.ts
    Screenshot 2022-02-21 at 6 59 21 PM

  • shared/types/user.ts
    Screenshot 2022-02-21 at 6 59 39 PM

  • shared/utils/file-validation.ts
    export const VALID_EXTENSIONS

  • shared/utils/immutable-array-fns.ts

    • Not used in server, can keep it in react branch for now
      Add
export const insertAt = <T>(
  array: ExtractTypeFromArray<T>[],
  index: number,
  valueToInsert: ExtractTypeFromArray<T>,
): ExtractTypeFromArray<T>[] => {
  return [...array.slice(0, index), valueToInsert, ...array.slice(index)]
}

Screenshot 2022-02-21 at 7 08 17 PM
Screenshot 2022-02-21 at 7 11 44 PM

/**
 * Handler for GET /frontend/env endpoint.
 * @returns the environment variables needed to hydrate the frontend.
 */
export const handleGetEnvironment: ControllerHandler<never, ClientEnvVars> = (
  _req,
  res,
) => {
  return res.json(getClientEnvVars())
}

Screenshot 2022-02-21 at 7 09 35 PM

  • src/app/modules/user/user.controller.ts
    Update types
    Screenshot 2022-02-21 at 7 10 18 PM

  • src/app/modules/user/user.utils.ts
    Remove InvalidOtpError -> unauthorised (will remove login session)
    Screenshot 2022-02-21 at 7 11 18 PM

  • src/types/api/form_auth.ts
    Not used in react, so not updating for now

@karrui
Copy link
Contributor Author

karrui commented Mar 2, 2022

Closed by above PRs.

@karrui karrui closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant