From 90a0fb04c450607c5e246c153583844bfe6d42dc Mon Sep 17 00:00:00 2001 From: Kar Rui Lau Date: Fri, 30 Jul 2021 14:55:25 +0800 Subject: [PATCH 1/2] feat: remove validation when logging esrvcId to login collection not needed, and part of the incomplete hotfix undertaken in #2470 --- src/app/models/__tests__/login.server.model.spec.ts | 13 ------------- src/app/models/login.server.model.ts | 4 ---- 2 files changed, 17 deletions(-) diff --git a/src/app/models/__tests__/login.server.model.spec.ts b/src/app/models/__tests__/login.server.model.spec.ts index 1c625b1d2f..b95fa56476 100644 --- a/src/app/models/__tests__/login.server.model.spec.ts +++ b/src/app/models/__tests__/login.server.model.spec.ts @@ -104,19 +104,6 @@ describe('login.server.model', () => { mongoose.Error.ValidationError, ) }) - - it('should throw validation error when esrvcId param is invalid format', async () => { - // Act - const actualPromise = LoginModel.create({ - ...DEFAULT_PARAMS, - esrvcId: 'id with spaces', - }) - - // Assert - await expect(actualPromise).rejects.toThrowError( - 'e-service ID must be alphanumeric, dashes are allowed', - ) - }) }) describe('Statics', () => { diff --git a/src/app/models/login.server.model.ts b/src/app/models/login.server.model.ts index d9276d302d..2e254e147f 100644 --- a/src/app/models/login.server.model.ts +++ b/src/app/models/login.server.model.ts @@ -39,10 +39,6 @@ const LoginSchema = new Schema( esrvcId: { type: String, required: true, - validate: [ - /^([a-zA-Z0-9-]){1,25}$/i, - 'e-service ID must be alphanumeric, dashes are allowed', - ], }, }, { From 7c87b106400c1fbd197fe503cfa716a0b169f8c0 Mon Sep 17 00:00:00 2001 From: Kar Rui Lau Date: Fri, 30 Jul 2021 15:06:41 +0800 Subject: [PATCH 2/2] chore: bump version to v5.21.2 --- CHANGELOG.md | 7 +++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87352bba74..39ddd396be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v5.21.2](https://github.com/opengovsg/FormSG/compare/v5.21.1...v5.21.2) + +- feat: remove validation when logging esrvcId to login collection [`90a0fb0`](https://github.com/opengovsg/FormSG/commit/90a0fb04c450607c5e246c153583844bfe6d42dc) + #### [v5.21.1](https://github.com/opengovsg/FormSG/compare/v5.21.0...v5.21.1) +> 29 July 2021 + +- chore: bump version to v5.21.1 [`139cd93`](https://github.com/opengovsg/FormSG/commit/139cd931e96e92ba5c267dbd8a62124ac058acfe) - fix: allow underscores in form esrvcId validation [`1e7f725`](https://github.com/opengovsg/FormSG/commit/1e7f7250de8621506b916d7b54bde6ab27a225f1) #### [v5.21.0](https://github.com/opengovsg/FormSG/compare/v5.20.0...v5.21.0) diff --git a/package-lock.json b/package-lock.json index d4f3852e90..d00b51130f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "FormSG", - "version": "5.21.1", + "version": "5.21.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 296bffd645..b386beb215 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "FormSG", "description": "Form Manager for Government", - "version": "5.21.1", + "version": "5.21.2", "homepage": "https://form.gov.sg", "authors": [ "FormSG "